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.v24.2.dll
Declaration
Property Value
Type | Default | Description |
---|---|---|
DefaultBoolean | Default |
|
Available values:
Name | Description | Return Value |
---|---|---|
True | The value is true. |
|
False | The value is false. |
|
Default | The value is specified by a global option or a higher-level object. |
|
Property Paths
You can access this nested property as listed below:
Object Type | Path to AllowExpandCollapseWithArrowKeys |
---|---|
TreeList |
|
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;
}