Back to Devexpress

ASPxTreeList.Styles Property

aspnet-devexpress-dot-web-dot-aspxtreelist-dot-aspxtreelist-f9d0ce8f.md

latest2.2 KB
Original Source

ASPxTreeList.Styles Property

Provides access to the style settings that control the appearance of the ASPxTreeList’s elements.

Namespace : DevExpress.Web.ASPxTreeList

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

NuGet Package : DevExpress.Web

Declaration

csharp
public TreeListStyles Styles { get; }
vb
Public ReadOnly Property Styles As TreeListStyles

Property Value

TypeDescription
TreeListStyles

A TreeListStyles object that provides style settings used to paint the ASPxTreeList.

|

Remarks

The following example shows how to customize style settings used to paint column headers and the focused node in code:

csharp
protected void Page_Load(object sender, EventArgs e) {
    ASPxTreeList1.Styles.Header.Assign(CreateHeaderStyle());
    CustomizeFocusedNodeStyle(ASPxTreeList1, Color.Orange, Color.Black);
}
private void CustomizeFocusedNodeStyle(ASPxTreeList treeList, Color bkColor, Color foreColor) {
    treeList.Styles.FocusedNode.BackColor = bkColor;
    treeList.Styles.FocusedNode.ForeColor = foreColor;
}
private TreeListHeaderStyle CreateHeaderStyle() {
    TreeListHeaderStyle style = new TreeListHeaderStyle();
    style.BackColor = Color.LightBlue;
    style.ForeColor = Color.Gray;
    style.Font.Italic = true;
    return style;
}

For more information, see Appearance Customization.

See Also

Tree List

ASPxTreeList Class

ASPxTreeList Members

DevExpress.Web.ASPxTreeList Namespace