Cell Value Selected


AOA,

How can i get cell value selected on cell click ...

3 Replies

AD Administrator Syncfusion Team December 5, 2006 12:35 PM UTC

Hi Ubaid,

Please try this code.

object ocellvalue = this.grid.Model[e.RowIndex,e.ColIndex].CellValue;

Best Regards,
Haneef


AD Administrator Syncfusion Team December 6, 2006 07:47 AM UTC


Hi ... Sorry for putting an ambiguous question ...

Actually, i dont want to get the value of cell, what i want is ... that when i click on a cell, the text in that cell gets selected like when we double click in a cell, whole of the text gets selected.


AD Administrator Syncfusion Team December 6, 2006 09:09 AM UTC

Hi Ubaid,

You can access the GridTextBoxCellRenderer and call Select() method to select a portion of text inside TextBoxCell. Here is a code snippet to show this.

//Use this code CellClick event
GridCurrentCell cc = this.grid.CurrentCell;
cc.MoveTo(e.RowIndex,e.ColIndex);
cc.BeginEdit();

GridTextBoxCellRenderer cr = cc.Renderer as GridTextBoxCellRenderer;
cr.TextBox.Select(1,5);

Best Regards,
Haneef

Loader.
Up arrow icon