Click cell select all

Hi,

I have a gridcontrol with one column editable. I would like to select all inside the cell whenever the user click cell. So I can garantee the user will change the whole value, but not adding numbers in between by accident.

Is there a way to do it?
Thanks a log

Chris

2 Replies

AD Administrator Syncfusion Team August 3, 2006 04:40 AM UTC

Hi Chris,

Set the ActivateCurrentCellBehavior property of the grid to GridCellActivateAction.SelectAll, this will help you to select all text when ever a cell becomes current cell.

this.gridControl1.ActivateCurrentCellBehavior = GridCellActivateAction.SelectAll;

To avoid the numbers being entered, the CurrentCellKeyPress event can be handled to do it. Below is the code snippet.

if(char.IsDigit(e.KeyChar))
{
e.Handled = true;
}

Thanks for using Syncfusion Products.
Regards,
Rajagopal


AD Administrator Syncfusion Team August 3, 2006 01:07 PM UTC


work perfectly. thanks a lot
>Hi Chris,

Set the ActivateCurrentCellBehavior property of the grid to GridCellActivateAction.SelectAll, this will help you to select all text when ever a cell becomes current cell.

this.gridControl1.ActivateCurrentCellBehavior = GridCellActivateAction.SelectAll;

To avoid the numbers being entered, the CurrentCellKeyPress event can be handled to do it. Below is the code snippet.

if(char.IsDigit(e.KeyChar))
{
e.Handled = true;
}

Thanks for using Syncfusion Products.
Regards,
Rajagopal

Loader.
Up arrow icon