To reproduce:
- add a grid to the form and use the following code for its setup:
radGridView2.Columns.Add("ID");
radGridView2.Columns.Add("Title");
radGridView2.MultiSelect = true;
radGridView2.Columns[0].SortOrder = RadSortOrder.Ascending;
radGridView2.ReadOnly = true;
radGridView2.BeginUpdate();
for (int i = 0; i < 5; i++)
{
GridViewDataRowInfo row = new GridViewDataRowInfo(radGridView2.MasterTemplate.MasterViewInfo);
row.Cells["ID"].Value = i;
row.Cells["Title"].Value = "Title " + i;
radGridView2.Rows.Add(row);
}
radGridView2.EndUpdate(true);
radGridView2.Rows[0].IsCurrent = true;
radGridView2.Rows[0].IsSelected= true;
- Once the application is started, hold down the shift key and click the third row in the grid
Expected result: the first three rows are selected
Actual result: the last three rows are selected
WORKAROUND:
Use the BeginUpdate and EndUpdate methods of the TableElement, not the control:
radGridView2.TableElement.BeginUpdate();
//add rows
radGridView2.TableElement.EndUpdate(true);