In a webform how do I populate a treeview from a dataset?
All the examples seem to use xml.
Thanks in Advance
Printable View
In a webform how do I populate a treeview from a dataset?
All the examples seem to use xml.
Thanks in Advance
Just loop through the dataset and add items to the treeview programmatically.
There is no simple way like Treeview1.Data= YourDataSet, so you just have to do something like:
VB Code:
'I dont know the specific code for adding to a treeview, but it would be somthing like this Dim tItem as TreeViewItem For x = 0 to ds1.Rows.Count-1 tItem = New TreeViewItem tItem.text = ds1.Rows(x).Item(0).ToSTring() TreeView1.Items.Add(tItem) Next