Skip to main content
All docs
V26.1
  • DxTreeList.EnterKeyDirection Property

    In EditCell mode, specifies where focus moves after a user presses Enter.

    Namespace: DevExpress.Blazor

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

    Declaration

    [DefaultValue(TreeListEnterKeyDirection.None)]
    [Parameter]
    public TreeListEnterKeyDirection EnterKeyDirection { get; set; }

    Property Value

    Type Default Description
    TreeListEnterKeyDirection None

    An enumeration value.

    Available values:

    Name Description
    None

    Validate the cell value and close the in-place editor. The current cell remains focused.

    Column

    Enter and Shift+Enter move focus one cell down or up in the same column.

    Row

    Enter and Shift+Enter move focus one cell right or left in the same row. Focus can move to the next/previous row if the current cell is last/first.

    Remarks

    The TreeList component supports several keyboard shortcuts that speed up navigation and editing. When a user focuses a cell and presses Enter, an in-place editor opens, where the user can modify cell content. If an in-place editor is already open, Enter applies changes and closes the editor.

    The EnterKeyDirection property specifies where focus moves after you press Enter.

    Note

    To use the Enter key in TreeList, set EditMode to TreeListEditMode.EditCell.

    The following code snippet implements Excel-like behavior, where Enter moves focus to the cell below.

    <DxTreeList @ref="TreeList"
                Data="DataSource"
                KeyFieldName="Id"
                ParentKeyFieldName="ParentId"
                HasChildrenFieldName="HasChildren"
                EditMode="TreeListEditMode.EditCell"
                EnterKeyDirection="TreeListEnterKeyDirection.Column"
                EditOnKeyPress="true">
        <Columns>
            *@* ... *@
        </Columns>
    </DxTreeList>
    

    Move Focus on Enter

    Run Demo: Edit Cell

    Tip

    Shift+Enter moves focus in the opposite direction.

    Enable EditOnKeyPress to make data entry smoother and faster. This option activates the focused cell editor when the user starts typing, without an extra click or key press.

    Implements

    See Also