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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Cell select all text behavior when user click on it

Thread ID:





96924 Oct 13,2010 03:14 PM UTC Oct 14,2010 08:13 PM UTC WinForms 2
Tags: GridControl
Asked On October 13, 2010 03:14 PM UTC


When the user click on a cell to edit the text, the default behavior is to select all the text. It's a good default behavior since most of the time users expect to replace the text, but in this specific case the user expect to add text. So we would like to change that behavior so the cursor is position at the end of the text when the user click on the cell to edit it.

Is there a way to do this?



Replied On October 14, 2010 03:45 PM UTC

Never mind, I found the solution

Just need to hook to gridControl.CurrentCellControlGotFocus, cast the control to GridOriginalTextBoxControl and update the SelectionLength and SelectionStart properties

gridControl.CurrentCellControlGotFocus += new ControlEventHandler(gridBinder_CurrentCellControlGotFocus);


private void gridBinder_CurrentCellControlGotFocus(object sender, ControlEventArgs e)
GridOriginalTextBoxControl textBoxControl = e.Control as GridOriginalTextBoxControl;
if (textBoxControl == null)

textBoxControl.SelectionLength = 0;
textBoxControl.SelectionStart = textBoxControl.TextLength;



Rajadurai C [Syncfusion]
Replied On October 14, 2010 08:13 PM UTC

Hi Dominik,

Thanks for your interest in Syncfusion Products.

You could get the SelectAll functionality in gridcell by handling the following property setting alone.

this.gridControl1.ActivateCurrentCellBehavior = GridCellActivateAction.SelectAll;

Please let us know if you have any further concerns.



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.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon 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.Close Icon