The problem is not selecting cell (0,0) but rather if I select any other cell besides that one for example cell (3,3).
The gridControl1_SelectionChanging event will show that i''ve selected (0,0) ie
e.Range.Top = 0
e.Range.Left = 0
If I select multiple cells again the e.Range values start from (0,0) regardless of where I click on the grid.
I want to retrieve the actual row and column index on the grid not the index within the range.
>Hi Mike,
To change the default selection color, you can set the AlphaBlendSelectionColor property to any user desired color.
this.gridControl1.AlphaBlendSelectionColor = Color.Orange;
set the AllowSelection property, that defines the selection behavior of the grid
this.gridControl1.AllowSelection = GridSelectionFlags.Any; // to select multiple cells
By default, when you try to select cell(0,0) in grid, entire table will get selected. If you dont want this behavior and want to select something else, then SelectionChanging event can be handled.
private void gridControl1_SelectionChanging(object sender, GridSelectionChangingEventArgs e)
{
if(e.Range.IsTable) // checking if cell(0, 0) is selected
{
e.Cancel = true;
this.gridControl1.Selections.Add(GridRangeInfo.Cell(0, 1));
}
}
Let me know if you have any other questions.
Regards,
Rajagopal