Back to Devexpress

TreeListOptionsNavigation.AllowExpandCollapseWithArrowKeys Property

windowsforms-devexpress-dot-xtratreelist-dot-treelistoptionsnavigation-d4ae5c57.md

latest4.2 KB
Original Source

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.2.dll

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

Declaration

csharp
[DefaultValue(DefaultBoolean.Default)]
[XtraSerializableProperty]
public virtual DefaultBoolean AllowExpandCollapseWithArrowKeys { get; set; }
vb
<DefaultValue(DefaultBoolean.Default)>
<XtraSerializableProperty>
Public Overridable Property AllowExpandCollapseWithArrowKeys As DefaultBoolean

Property Value

TypeDefaultDescription
DefaultBooleanDefault

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

|

Available values:

NameDescriptionReturn 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 TypePath 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:

  • When the focused row is expanded:

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.

csharp
using DevExpress.Utils;
public Form1()
{
  InitializeComponent();
  treeList1.OptionsNavigation.AllowExpandCollapseWithArrowKeys = DefaultBoolean.True;
}
vb
Imports DevExpress.Utils
Public Sub New()
  InitializeComponent()
  treeList1.OptionsNavigation.AllowExpandCollapseWithArrowKeys = DefaultBoolean.True
End Sub

See Also

Navigating Through Nodes and Cells

Expanding and Collapsing Nodes

Focus and Navigation

TreeListOptionsNavigation Class

TreeListOptionsNavigation Members

DevExpress.XtraTreeList Namespace