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.

Sellect all text in GridTextBoxControl

Thread ID:

Created:

Updated:

Platform:

Replies:

98734 Mar 23,2011 08:24 AM Mar 25,2011 03:30 AM Windows Forms 1
loading
Tags: GridControl
Juraj Tomana
Asked On March 23, 2011 08:24 AM

Hi,

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 03:30 AM

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;

Regards,
Jisha


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.

;