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

Sellect all text in GridTextBoxControl

Thread ID:





98734 Mar 23,2011 12:24 PM UTC Mar 25,2011 07:30 AM UTC WinForms 1
Tags: GridControl
Juraj Tomana
Asked On March 23, 2011 12:24 PM UTC


How can I select all text in GridTextBoxControl, when I start edit?

I tried this:

private void grid_CurrentCellControlGotFocus(object sender, ControlEventArgs e)
GridTextBoxControl textBox = grid.CurrentCell.Renderer.Control as GridTextBoxControl;

if (textBox != null)
textBox.SelectionStart = 0;
textBox.SelectionLength = textBox.Text.Length;

But this didn't work.

Jisha Joy [Syncfusion]
Replied On March 25, 2011 07:30 AM UTC

Hi Juraj,

You can achieve the desired behavior by setting the ActivateCurrentCellBehavior property to GridCellActivateAction.SelectAll. Please refer to the code,

this.gridControl1.ActivateCurrentCellBehavior = GridCellActivateAction.SelectAll;



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