A newer version of this page is available. Switch to the current version.

TreeListNode.IsExpandButtonVisible Property

Gets or sets whether the expand button is displayed within the node or not.

Namespace: DevExpress.Xpf.Grid

Assembly: DevExpress.Xpf.Grid.v19.1.dll

Declaration

public DefaultBoolean IsExpandButtonVisible { get; set; }

Property Value

Type Description
DefaultBoolean

A DefaultBoolean enumeration value that specifies the expand button’s visibility within the node.

Available values:

Name Description
True

Corresponds to a Boolean value of true.

False

Corresponds to a Boolean value of false.

Default

The value is determined by the current object’s parent object setting (e.g., a control setting).

Remarks

The TreeListView.NodeExpanding event can be handled to dynamically create child nodes. In this instance, when expanding a node, you do not know whether it has child nodes or not. If the node has no child nodes, hide the expand button by setting the IsExpandButtonVisible property to false.

To learn more, see Expanding and Collapsing Nodes .

Examples

In this example, 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