Hi
I have a datagrid without paging.
<RadzenDataGrid @ref=dataGrid Style="height: 420px" Data="@dzialList"
After adding the row, I reload the data and call the javascript, which sets the visibility of the highlighted row by reading its position in the list.
This works great for editing, but after adding a row and reloading the data, dataGrid.View.ToList() does not contain the new row yet. Despite the orders
await dataGrid.Reload();
StateHasChanged();
After the procedure is completed, the new row is visible in the grid, but scrolling did not work.
-> Adds row
dynamic dialogResult =
await DialogService.OpenAsync<DzialDialog>(editName, new Dictionary<string, object>() { { "id", 0 }, { "viewMode", false } },
new DialogOptions() { Width = "700px", Height = "500", Resizable = false, Draggable = true });
if (dialogResult != null)
{
dzial = (Dzial) dialogResult;
var query = planData.nxPlanowanieDataContext.Dzials.Where(x => x.IdDzial > 0).AsQueryable();
//...
dzialList = query.ToList();
await dataGrid.Reload();
StateHasChanged();
//Now try find dzial in dzialList
int index = dataGrid.View.ToList().IndexOf(dzial);
//The new line is not in the list
Thans
Maciej