How to select a cell

I just want to select a cell, so it is the current cell.


3 Replies

AD Administrator Syncfusion Team February 23, 2007 10:26 PM UTC

Hi,

This can be achieved by using SelectRange method in the Selections property. The following is the code snippet, please try it and let us know if you need any further assistance.

this.gridControl1.Selections.SelectRange(GridRangeInfo.Cell(a,b), true);

Here I attached my sample,

http://www.syncfusion.com/Support/user/uploads/select_a_cell_42e564fd.zip


select_a_cell.zip


Best Regards,
S.Shyam.



ER Eric February 26, 2007 03:07 PM UTC

I'm just trying to select the first cell in the first column.
this.Selections.SelectRange(GridRangeInfo.Cell(0, 0), true);

Yet, even after this line, the RowIndex is -1:

this.CurrentCell.RowIndex; <- should NOT be -1


AD Administrator Syncfusion Team February 26, 2007 08:48 PM UTC

Figured it out:

this.CurrentCell.MoveTo(GridRangeInfo.Cell(1, 1), GridSetCurrentCellOptions.SetFocus);

this.CurrentCell.RowIndex is now 1.

Loader.
Up arrow icon