windowsforms-devexpress-dot-xtratreelist-dot-treelistoptionsnavigation-d4ae5c57.md
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
[DefaultValue(DefaultBoolean.Default)]
[XtraSerializableProperty]
public virtual DefaultBoolean AllowExpandCollapseWithArrowKeys { get; set; }
<DefaultValue(DefaultBoolean.Default)>
<XtraSerializableProperty>
Public Overridable Property AllowExpandCollapseWithArrowKeys As DefaultBoolean
| 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
|
You can access this nested property as listed below:
| Object Type | Path to AllowExpandCollapseWithArrowKeys |
|---|---|
| TreeList |
.OptionsNavigation .AllowExpandCollapseWithArrowKeys
|
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:
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;
}
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
TreeListOptionsNavigation Class