I have a list of objects
and i want to bind this list with the treeview control
my class is as follows
public class Tax
{
public string TaxName { get; set; }
public string TaxPresentationId { get; set; }
public string ParentTaxName { get; set; }
public string PresentationTaxName { get; set; }
public string RoleURl { get; set; }
public List<Tax> Child { get; set; }
public Tax()
{
Childrens = new List<Tax>();
}
}
I have one list with all the data
List<Tax> lstreportdata = new List<Tax>();
how can i bind this list into the treeview control.
thanks in advance.
You can’t. At least not directly. Take a look at the TreeView docs on MSDN.
The most common usage of a TreeView control is to display site map information, bound to an XmlDataSource.
You can also populate it programmatically with the PopulateOnDemand property.