Category / Section
How to programatically invert selection in WPF GridControl?
You can programmatically invert selection in GridControl by clearing existing selection and adding the cells other than previously selected cells GridControl.Model.SelectedRanges collection.
Refer below code for your reference.
C#
private void Button_Click(object sender, RoutedEventArgs e)
{
var currentSelectedRanges = grid.Model.SelectedRanges.Clone();
grid.Model.Selections.Clear(false);
for(int i=1;i<=grid.Model.RowCount;i++)
{
for(int j=1;j<=grid.Model.ColumnCount;j++)
{
var cellRange = GridRangeInfo.Cell(i, j);
if (!currentSelectedRanges.AnyRangeContains(cellRange))
{
grid.Model.SelectedRanges.Add(cellRange);
}
}
}
grid.Model.InvalidateVisual();
}

Sample: View sample in GitHub