Skip to main content
All docs
V26.1
  • TreeViewControl.ShowSelectionRectangle Property

    Gets or sets whether to display a selection rectangle when users select multiple nodes. This is a dependency property.

    Namespace: DevExpress.Xpf.Grid

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

    Declaration

    public bool ShowSelectionRectangle { get; set; }

    Property Value

    Type Description
    Boolean

    true to display the selection rectangle when users select multiple nodes; otherwise, false.

    Remarks

    When the ShowSelectionRectangle property is true, users can drag a rectangle to select multiple nodes.

    [NOTE] To enable the selection rectangle, set the ShowSelectionRectangle property to true, and the SelectionMode property to Row or Cell. The ShowSelectionRectangle property is ignored if the SelectionMode is set to MultipleRow.

    Use the SelectionRectangleStyle to customize the appearance of the selection rectangle.

    Example: Enable a Selection Rectangle

    The following example displays a rectangle when a user selects multiple nodes:

    TreeViewControl - Display Selection Rectangle

    <dx:ThemedWindow x:Class="TreeViewControlApp.MainWindow"
                     xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                     xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                     xmlns:dx="http://schemas.devexpress.com/winfx/2008/xaml/core"
                     xmlns:dxg="http://schemas.devexpress.com/winfx/2008/xaml/grid"
                     Title="TreeViewControl Demo" Height="450" Width="600">
            <dxg:TreeViewControl x:Name="tree"
                                 ChildNodesPath="Employees"
                                 TreeViewFieldName="Name"
                                 SelectionMode="Row"
                                 ShowSelectionRectangle="True"/>
    </dx:ThemedWindow>
    
    See Also