Back to Devexpress

GridEnterKeyDirection Enum

blazor-devexpress-dot-blazor-24bed4c4.md

latest2.6 KB
Original Source

GridEnterKeyDirection Enum

Lists values that specify where focus moves after a user presses Enter.

Namespace : DevExpress.Blazor

Assembly : DevExpress.Blazor.v25.2.dll

NuGet Package : DevExpress.Blazor

Declaration

csharp
public enum GridEnterKeyDirection

Members

NameDescription
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.

|

The following properties accept/return GridEnterKeyDirection values:

LibraryRelated API Members
BlazorDxGrid.EnterKeyDirection
IGrid.EnterKeyDirection
XAF: Cross-Platform .NET App UI & Web APIDxGridModel.EnterKeyDirection

Remarks

The EnterKeyDirection property specifies where focus moves after a user presses Enter or Shift+Enter to close the in-place editor.

If the editor is on the last row and GridEnterKeyDirection is Column, Enter will keep the focus on the current cell.

razor
<DxGrid @ref="Grid"
        Data="DataSource"
        KeyFieldName="EmployeeId"
        EditMode="GridEditMode.EditCell"
        EnterKeyDirection="GridEnterKeyDirection.Column">
    <Columns>
        *@* ... *@
    </Columns>
</DxGrid>

Run Demo: Edit Cell

User Input Validation

In EditCell mode, the Grid component validates cell values once the edited row loses focus. Validation behavior on Enter / Shift+Enter depends on the EnterKeyDirection value:

  • Column: Validation occurs immediately when you press the key.
  • Row: Validation occurs after you edit the last cell in the row and press the key. The component prevents users from editing another row until they address all validation errors.

See Also

DevExpress.Blazor Namespace