diff --git a/BlazorBootstrap.Demo.RCL/Components/Pages/Grid/01-Overview/Grid_Demo_01_Client_Side_Filtering_Paging_And_Sorting.razor b/BlazorBootstrap.Demo.RCL/Components/Pages/Grid/01-Overview/Grid_Demo_01_Client_Side_Filtering_Paging_And_Sorting.razor index 75600cffe..4bd565772 100644 --- a/BlazorBootstrap.Demo.RCL/Components/Pages/Grid/01-Overview/Grid_Demo_01_Client_Side_Filtering_Paging_And_Sorting.razor +++ b/BlazorBootstrap.Demo.RCL/Components/Pages/Grid/01-Overview/Grid_Demo_01_Client_Side_Filtering_Paging_And_Sorting.razor @@ -1,14 +1,15 @@ + SelectionMode="GridSelectionMode.Multiple"> diff --git a/blazorbootstrap/Components/Grid/Grid.razor b/blazorbootstrap/Components/Grid/Grid.razor index f3ceacba9..1b6771be7 100644 --- a/blazorbootstrap/Components/Grid/Grid.razor +++ b/blazorbootstrap/Components/Grid/Grid.razor @@ -147,7 +147,7 @@ { var rowClass = RowClass?.Invoke(item) ?? ""; var detailViewRowId = IdUtility.GetNextId(); - + @if (AllowDetailView) { diff --git a/blazorbootstrap/Components/Grid/Grid.razor.cs b/blazorbootstrap/Components/Grid/Grid.razor.cs index df5870e70..63d3f37b4 100644 --- a/blazorbootstrap/Components/Grid/Grid.razor.cs +++ b/blazorbootstrap/Components/Grid/Grid.razor.cs @@ -995,6 +995,18 @@ private void SetFilters(IEnumerable filterItems) [Parameter] public Func? RowClass { get; set; } + /// + /// Gets or sets the function used to extract a unique key from a row item. + /// + /// + /// The key returned by the function is used to uniquely identify each row in the data set. This + /// is typically required for operations such as tracking changes or rendering rows efficiently. + /// If not set, the item hash code will be used as the key. + /// Example usage: `RowKeySelector="(employee) => employee.Id"`. + /// + [Parameter] + public Func? RowKeySelector { get; set; } + /// /// Gets or sets the selected items. ///