Hi Dilyan,
I had a look at that option but unfortunately it doesn't fit my use case. A user can select rows on the grid by pasting in a list of Ids from an external source, e.g. Excel. That means I can't give a start / end index as selected rows are scattered all over the grid.
For 1,000 Ids this takes a less than a second but for 10,000 it takes 15+ seconds and the UI feels like it has crashed.
If it can't be done it's ok, I can instead send the Ids to the server as a SQL filter rather than a grid selection but it would be a better user experience if I could select them.
Example code below where idHash is a HastSet<int> of 10,000 Ids.
Thanks,
Richard
// Pause Grid SelectionChanged Event
_grid.SelectionChanged -= GridOnSelectionChanged;
var lastIdToSelect = idHash.First();
idHash.Remove(lastIdToSelect);
// Select the rows on the grid
foreach
(IId row
in
_grid.Items)
if
(idHash.Contains(row.Id))
_grid.SelectedItems.Add(row);
// Resume Grid SelectionChanged Event
_grid.SelectionChanged += GridOnSelectionChanged;
// Select 1 last row to trigger selection event
foreach
(IId row
in
_grid.Items)
{
if
(row.Id != lastIdToSelect)
continue
;
_grid.SelectedItems.Add(row);
break
;
}