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 : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Howto:? select text in a cell

Thread ID:

Created:

Updated:

Platform:

Replies:

6781 Aug 27,2003 07:40 PM UTC Feb 23,2009 02:14 PM UTC WinForms 5
loading
Tags: GridControl
Peter
Asked On August 27, 2003 07:40 PM UTC

using this code: GridTextBoxControl tb; if (gridControl1[gridControl1.CurrentCell.RowIndex, gridControl1.CurrentCell.ColIndex].CellType == "TextBox") { tb = (GridTextBoxControl)gridControl1.CurrentCell.Renderer.Control; tb.SelectAll(); } does not work. Is there a better way of doing this? This runs on CurrentCellActivated with the purpose to highlight all text when a user switches cells

Administrator [Syncfusion]
Replied On August 27, 2003 07:50 PM UTC

You can set the grid's ActivateCurrentCellBehavior property to SelectAll. This should select all the text for you when you click into a cell. You can do this from the designer or from code in Form_Load.

Peter
Replied On August 27, 2003 10:02 PM UTC

Thanks, that works

Sameer Khan
Replied On February 20, 2009 03:32 PM UTC

I cannot find the corresponding property for a GGC. Does it not support the behavior?

>Thanks, that works


Sameer Khan
Replied On February 20, 2009 03:38 PM UTC


this.gridGroupingControl1.TableModel.Options.ActivateCurrentCellBehavior = GridCellActivateAction.SelectAll Works, but I would like to be able to specify this behavior on a Column level .. is that possible


>I cannot find the corresponding property for a GGC. Does it not support the behavior?

>Thanks, that works




Rajadurai C [Syncfusion]
Replied On February 23, 2009 02:14 PM UTC

Hi Sameer,

Thanks for your interest in Syncfusion products.

You can set the SelectAll property for specific column through TableControlCurrentCellActivating event handler. Please refer to the following code.

void gridGroupingControl1_TableControlCurrentCellActivated(object sender, GridTableControlEventArgs e)
{
GridCurrentCell cc = e.TableControl.CurrentCell;
if (cc.RowIndex > 3 && cc.ColIndex > 0)
{
if (cc.ColIndex == 2)
{
this.gridGroupingControl1.TableModel.Options.ActivateCurrentCellBehavior = GridCellActivateAction.SelectAll;
}
else
{
this.gridGroupingControl1.TableModel.Options.ActivateCurrentCellBehavior = GridCellActivateAction.PositionCaret;
}
}
}


Regards,
Rajadurai


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.

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

;