Add row focusing support to CatalogsGrid and MassDataGrid

Enable row focusing in both grid components by introducing the focusedRowKey property and binding it to the grid. After create or update operations, set focusedRowKey to the affected item's key, ensuring the grid automatically focuses the relevant row. Improves user experience by highlighting newly created or updated items.
This commit is contained in:
OlgunR
2026-02-17 12:40:37 +01:00
parent 797dd44f25
commit 9a4f189e4e
2 changed files with 10 additions and 1 deletions

View File

@@ -128,6 +128,8 @@ else
CustomizeEditModel="OnCustomizeEditModel"
EditModelSaving="OnEditModelSaving"
DataItemDeleting="OnDataItemDeleting"
FocusedRowEnabled="true"
@bind-FocusedRowKey="focusedRowKey"
@ref="gridRef">
<Columns>
@RenderColumns()
@@ -171,6 +173,7 @@ else
private EditContext? editContext;
private ValidationMessageStore? validationMessageStore;
private IGrid? gridRef;
private int? focusedRowKey;
private string popupHeaderText = "Edit";
private const string LayoutType = "GRID_BANDS";
private const string LayoutKey = "CatalogsGrid";
@@ -347,6 +350,7 @@ else
}
infoMessage = "Katalog angelegt.";
focusedRowKey = created.Value.Guid;
}
else
{
@@ -359,6 +363,7 @@ else
}
infoMessage = "Katalog aktualisiert.";
focusedRowKey = editModel.Guid;
}
await LoadCatalogs();