How do you use
FlyTreeView.ConvertTabularDataToHierarchical(..) method?
Here what you need to add and display Test column.
using System;
using System.Data;
using System.Web;
using System.Web.UI;
public partial class Demo_DataBinding_Tabular : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
// Create sample data
DataSet dSet = new DataSet(\"DataBase\");
DataTable dTable = new DataTable(\"Orders\");
dSet.Tables.Add(dTable);
dTable.Columns.Add(\"ID\");
dTable.Columns.Add(\"OwnerID\");
dTable.Columns.Add(\"Title\");
dTable.Columns.Add(\"Selected\");
dTable.Columns.Add(\"Test\");
// Add nodes (OwnerID is null for root nodes)
dTable.Rows.Add(new object[] { 1, null, \"Developer Tools\", false, \"TestText\"});
dTable.Rows.Add(new object[] { 2, 1, \"Spices.Net\", true, \"TestText\" });
dTable.Rows.Add(new object[] { 3, 1, \"Spices.Obfuscator\", false, \"TestText\" });
dTable.Rows.Add(new object[] { 4, 1, \"Spices.Decompiler\", false, \"TestText\" });
dTable.Rows.Add(new object[] { 5, null, \".Net Controls\", false, \"TestText\" });
dTable.Rows.Add(new object[] { 6, 5, \"FlyGrid.Net\" });
dTable.Rows.Add(new object[] { 7, 5, \"FlyTreeView for ASP.NET 1.1\", false, \"TestText\" });
dTable.Rows.Add(new object[] { 8, 5, \"FlyTreeView for ASP.NET 2.0\", true, \"TestText\" });
// Call FlyTreeView.ConvertTabularDataToHierarchical method to convert into hierarchical datasource
IHierarchicalEnumerable hierarchicalData =
NineRays.WebControls.FlyTreeView.ConvertTabularDataToHierarchical(dSet, \"Orders\", \"ID\", \"OwnerID\");
// Bind the treeview
flyTreeView.DataSource = hierarchicalData;
flyTreeView.DataBind();
}
}
}
So Test column will be shown when using
Also why do you need to use Depth attribute? It is zero-based value that filters nodes by level (also zero-based). So in your case this node binding will not work for root nodes.