Skip to main content
All docs
V25.1
  • TreeListOptionsNavigation.AllowExpandCollapseWithArrowKeys Property

    Gets or sets whether to allow a user to expand/collapse TreeList nodes with the Left and Right arrow keys without holding Ctrl.

    Namespace: DevExpress.XtraTreeList

    Assembly: DevExpress.XtraTreeList.v25.1.dll

    NuGet Packages: DevExpress.Win.Navigation, DevExpress.Win.TreeList

    Declaration

    [DefaultValue(DefaultBoolean.Default)]
    [XtraSerializableProperty]
    public virtual DefaultBoolean AllowExpandCollapseWithArrowKeys { get; set; }

    Property Value

    Type Default Description
    DefaultBoolean Default

    true to allow a user to expand/collapse TreeList nodes with the Left and Right arrow keys without holding Ctrl; otherwise, false.

    Available values:

    Name Description Return Value
    True

    The value is true.

    0

    False

    The value is false.

    1

    Default

    The value is specified by a global option or a higher-level object.

    2

    Property Paths

    You can access this nested property as listed below:

    Object Type Path to AllowExpandCollapseWithArrowKeys
    TreeList
    .OptionsNavigation .AllowExpandCollapseWithArrowKeys

    Remarks

    If the AllowExpandCollapseWithArrowKeys property is set to DefaultBoolean.Default, the TreeList behavior depends on the WindowsFormsSettings.KeyboardNavigationExtensions setting that specifies the behavior of all TreeLists in the application. If the KeyboardNavigationExtensions property is set to TreeList or All, users can expand/collapse TreeList nodes with the Left and Right arrow keys without holding Ctrl.

    Enable the AllowExpandCollapseWithArrowKeys option to allow users to perform the following actions:

    • When the focused row is collapsed:

      Move focus to the leftmost row cell and press the right arrow key to expand the row.

      Note

      If the row is already expanded or has no children, focus will move to the next cell in the row.

    • When the focused row is expanded:

      Move focus to the leftmost row cell and press the left arrow key to collapse the row.

      Note

      If the node has no children or is already collapsed, focus will move to the parent row.

    Example

    The following code sets the AllowExpandCollapseWithArrowKeys property in the form’s constructor to allow a user to expand/collapse TreeList nodes with the Left and Right arrow keys without holding Ctrl.

    using DevExpress.Utils;
    public Form1()
    {
      InitializeComponent();
      treeList1.OptionsNavigation.AllowExpandCollapseWithArrowKeys = DefaultBoolean.True;
    }
    

    WinForms TreeList AllowExpandCollapseWithArrowKeys property

    See Also