Thoughts on specifying @key for each row in grid

Based on the example of @key usage with lists discussed in https://devblogs.microsoft.com/aspnet/asp-net-core-and-blazor-updates-in-net-core-3-0-preview-6/, we're wondering if you have any recommendations on specifying @key for each row in a datagrid?

currently, when we're adding rows to a datagrid, we just re-get data from the database that would include the successfully saved new data in their properly sorted order, but we're about to try just inserting the (successfully saved) new data into their desired positions if we're dealing with a grid that's not relatively large.

is it possible to do so with RadzenDataGrid? if yes, would u recommend doing it (that is, specifying @key for potential re-rendering performance gain?). thanks!

Hi @radzenfan,

There is no way currently to set the @key for DataGrid table rows. We will investigate if this has any real performance benefits and set it internally if there is a need to.

1 Like