I am trying to create webtree that will display a list of companies, broken down by their first character (alphabet list which opens to show all companies starting with that letter). But I can't seem to get it working. I am using MySQL as my database.
I am having some trouble to get my webtree to display on the screen. Only my WebPanel shows up, with a blank area where the webtree should be. The code seems to run without errors and when I walk through the code I can check the results of my datasets and they are returning the correct data. I am attaching the source code for my page along with a screen shot of the resulting screen (added borders to show where tree should show up, lower left below webpanel).
******************************************************************************************************************
using System;
using System.Data;
using System.Configuration;
using System.Data.Odbc;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
{
/// <summary>
/// Summary description for WebForm1.
/// </summary>
//WebPanel1.Visible = WebSamplesCS.Config.ShowDescription;
// Put user code to initialize the page here
// Get Database connection path for MSA db
OdbcConnection myConnection = new OdbcConnection(connectionString);
try
myConnection.Open();
}
catch
OdbcDataAdapter cmdAlpha = new OdbcDataAdapter("Select distinct LEFT(Name, 1) AS CompAlpha FROM Company ORDER BY CompAlpha", myConnection);
//OdbcDataAdapter cmdActions = new OdbcDataAdapter("Select * From tbl_Units, tbl_Assets where tbl_Units.unAssetsID = tbl_Assets.asUniqueNum", myConnection);
cmdCompany.Fill(treeview, "tbl_Company");
//cmdActions.Fill(treeview, "tbl_Actions");
//treeview.Relations.Add("Companies", treeview.Tables["tbl_Company"].Columns["asUniqueNum"], treeview.Tables["tbl_Units"].Columns["unAssetsID"]);
this.wtCompanyList.Levels[0].RelationName = "Alpha";
//this.wtCompanyList.Levels[1].RelationName = "Assets";
//this.wtCompanyList.Levels[2].ColumnName = "unName";
//
// CODEGEN: This call is required by the ASP.NET Web Form Designer.
InitializeComponent();
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
#endregion
I appreciate any help you can give me.