#103216
oliver.aldrian
Participant

I have

<Grid @ref="grid" OnCellClick="CellClicked" OnReady="(x) => GridReady(x)" DataSource="@projects">
<Columns>
                  <Column DataField="Id" Label="" Visible="false" AllowEdit="false" AllowSelect="false" />
                  <Column DataField="Name" Label="Name" AllowEdit="false" AllowSelect="false" />
</Columns>
</Grid>

and

private async void GridReady(Grid grid)
{
var selectedProjectId = await LocalStorage.GetItemAsync("SelectedProject");

if (!selectedProjectId.Equals(Guid.Empty) && projects.Any(x => x.Id.Equals(selectedProjectId)))
{
grid.SelectRows(projects.Where(x => x.Id.Equals(selectedProjectId)));
}
else
{
ClearSelection();
}
}
  1. I don’t have the index of the row I want to select, I have the object that is displayed in the row
  2. Setting a breakpoint into the GridReady Method I can see the page and grid load in the browser and can clearly see the entries in the grid. BUT grid.Rows is STILL EMPTY in this method.

Additional information: I am on Blazor .NET6 WebAssebmly and use the latest smart.Blazor version that nuget suggested.