Skip to content

GridSort

Static class in Oadm.Sdk.Client.Controls · Oadm.Sdk.Client.dll

Sorting a grid with a large selection. After a sort the grid looks up every selected row in the whole list (quadratic: 30,000 selected rows took 4 s, 100,000 took 45 s). From GridSort.LargeSelection rows on the selection comes off the grid before the sort and goes back right after it, all rows in one step. The host installs this for every grid of the client and of the plugins (GridSort.Install); a grid that handles its own sort sets Handled in an earlier Sorting handler (the device grid).

public static class GridSort
static void Attach(DataGrid grid)

Hooks the sort of one grid (once per grid).

static void Install()

Hooks the sort of every grid once it is loaded (the host calls this at start; tests too).

static bool IsMovingSelection(DataGrid grid)

True while the grid’s selection is off for a sort and on its way back: a SelectionChanged handler that hands the selection to a view model ignores the changes then (the same rows are selected afterwards).

const int LargeSelection = 1000

Selections from this size on are taken off the grid while it sorts.