Skip to main content

ASPxTreeList Class

Represents a server ASPxTreeList control.

Namespace: DevExpress.Web.ASPxTreeList

Assembly: DevExpress.Web.ASPxTreeList.v23.2.dll

NuGet Package: DevExpress.Web

Declaration

public class ASPxTreeList :
    ASPxDataWebControl,
    IWebColumnsOwner,
    IPagerOwner,
    IControlDesigner,
    IBasePrintable,
    ITreeListExportOwner,
    IPopupFilterControlOwner,
    IFilterControlRowOwner,
    IFilterControlOwner,
    IPopupFilterControlStyleOwner,
    IHeaderFilterPopupOwner,
    ISkinOwner,
    IPropertiesOwner,
    IFilterHelperOwner,
    IBatchEditHelperOwner,
    IPostBackValueSecureValidationOwner,
    ITreeListDataGuardInfoProvider,
    IDataGuardInfoProvider

Remarks

The ASPxTreeList is a multi-purpose data visualization control that can display information as a tree or grid - either in data-bound or unbound mode.

ASPxTreeList

The ASPxTreeList provides the following key features

Note

The ASPxTreeList control provides you with a comprehensive client-side functionality implemented using JavaScript code:

The client-side API is always available for this control.

Example

In markup:

<dx:ASPxTreeList ID="ASPxTreeList1" runat="server" AutoGenerateColumns="False" DataSourceID="SqlDataSource1" KeyFieldName="ProductID">
  <Columns>
      <dx:TreeListTextColumn AutoFilterCondition="Default" FieldName="ProductName" ShowInFilterControl="Default" VisibleIndex="0">
      </dx:TreeListTextColumn>
      <dx:TreeListTextColumn AutoFilterCondition="Default" FieldName="UnitPrice" ShowInFilterControl="Default" VisibleIndex="1">
      </dx:TreeListTextColumn>
  </Columns>
</dx:ASPxTreeList>
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=F:\Docs\DB\nwind.mdb"
    ProviderName="System.Data.OleDb" SelectCommand="SELECT [ProductID], [ProductName], [UnitPrice] FROM [Products]">
</asp:SqlDataSource>

Programmatically:

<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=F:\Docs\DB\nwind.mdb"
    ProviderName="System.Data.OleDb" SelectCommand="SELECT [ProductID], [ProductName], [UnitPrice] FROM [Products]">
</asp:SqlDataSource>
using DevExpress.Web.ASPxTreeList;

protected void Page_Load(object sender, EventArgs e)
{
    ASPxTreeList treeList = new ASPxTreeList();
    treeList.ID = "ASPxTreeList1";
    Page.Form.Controls.Add(treeList);
    treeList.Columns.Add(new TreeListDataColumn("ProductID"));
    treeList.Columns.Add(new TreeListDataColumn("ProductName"));
    treeList.Columns.Add(new TreeListDataColumn("UnitPrice"));
    treeList.AutoGenerateColumns = false;
    treeList.KeyFieldName = "ProductID";

    treeList.DataSourceID = "SqlDataSource1";
    treeList.DataBind();
}
See Also