Here is code that loops through all the selected rows.
private void button1_Click(object sender, EventArgs e)
{
int totalRows = 0;
string printRows = "rows: ";
foreach(GridRangeInfo range in this.gridControl1.Selections.GetSelectedRows(true,false))
{
totalRows += range.Bottom - range.Top + 1;
for(int i = range.Top; i <= range.Bottom; i++)
{
printRows += i.ToString()+" ";
}
}
MessageBox.Show(string.Format("Total Rows: {0} Rows: {1}", totalRows, printRows));
}
To delete a record at a rowindex in the grid, you can use:
gridDataBoundGrid1.DeleteRecordsAtRowIndex
Or, you can also use gridDataBoundGrid1.Binder.RemoveRecords. But to use this, you need to use gridDataBoundGrid1.Binder.RowIndexToPosition to convert the rowindex to a record position.