- Online Barcode Generator
- How To
- Buy Now
Kettic DropDownTree control allows you to bind to various data sources, such as DataTable, Array, to name just a few. If any other data sources become popular choices for data binding, we might also considering adding that support in the future.
In this tutorial, we will provide a sample to show you how to easily bind Kettic DropDownTree to a DataTable in your ASP.NET web application. Before we get started that, first please get to know some of the properties and methods you might encounter later while binding Kettic DropDownTree to DataTable.
DataSource: Developers can use this property to set DropDownTree to an instance of your data source. If you would like to bind DropDownTree at run time, you can only set this property.
DataFieldID: This property specifies the field name from your data source. It is very useful for identifying each unique row from each other. This property cannot be avoided when you are binding a DropDownTree to hierarchical data.
DataFieldParentID: This property is also used specify the field name from your data source. However, it is different form DataFieldID because its function is to identify the row from the parent node. This property is generally used for hierarchical data binding.
DataFieldText: In general, this property is used during data binding process. It is used to specify the field name from the data source in order to populates each of the Node's Text property.
In the example below, we provide sample codes so you can bind your Kettic DropDownTree control to a DataTable with hierarchical data, and display a DropDownTree as specified in your data source.
<kettic:PerDropDownTree ID="PerDropDownTree1" runat="server" DefaultMessage="Please select" Width="250px"
Visual C# sample codes:
protected override void OnLoad(EventArgs e)
Here is how the DropDownTree looks like after binding to DataTable:
ASP.NET AJAX UI Controls