We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

Click cell select all

Thread ID:

Created:

Updated:

Platform:

Replies:

47333 Aug 2,2006 03:33 PM Aug 3,2006 09:07 AM Windows Forms 2
loading
Tags: GridControl
Administrator [Syncfusion]
Asked On August 2, 2006 03:33 PM

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

Administrator [Syncfusion]
Replied On August 3, 2006 12:40 AM

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

Administrator [Syncfusion]
Replied On August 3, 2006 09:07 AM


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

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;