Skip to main content

TreeListNodeBase.IsExpanded Property

Gets or sets whether or not the node is expanded.

Namespace: DevExpress.Data.TreeList

Assembly: DevExpress.Data.v24.1.dll

NuGet Package: DevExpress.Data

Declaration

public virtual bool IsExpanded { get; set; }

Property Value

Type Description
Boolean

true to expand the node; otherwise, false.

Remarks

To learn more, see Expanding and Collapsing Nodes .

Example

In this demo, the TreeListView displays the file/folder tree. Child nodes that correspond to sub folders or files contained within a folder are dynamically created when a parent node is being expanded.

<Window x:Class="DynamicNodeLoading.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="MainWindow" Height="350" Width="525" xmlns:dxg="http://schemas.devexpress.com/winfx/2008/xaml/grid">
    <Grid>
        <dxg:GridControl Name="grid">
            <dxg:GridControl.Columns>
                <dxg:GridColumn FieldName="Name" />
                <dxg:GridColumn FieldName="ItemType" />
                <dxg:GridColumn FieldName="Size" />
                <dxg:GridColumn FieldName="FullName" />
            </dxg:GridControl.Columns>
            <dxg:GridControl.View>
                <dxg:TreeListView Name="treeListView1" AutoWidth="True"
                                  NodeExpanding="treeListView1_NodeExpanding"/>
            </dxg:GridControl.View>
        </dxg:GridControl>
    </Grid>
</Window>
See Also