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.

Howto:? select text in a cell

Thread ID:

Created:

Updated:

Platform:

Replies:

6781 Aug 27,2003 03:40 PM Feb 23,2009 09:14 AM Windows Forms 5
loading
Tags: GridControl
Peter
Asked On August 27, 2003 03:40 PM

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 03:50 PM

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 06:02 PM

Thanks, that works

Sameer Khan
Replied On February 20, 2009 10:32 AM

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 10:38 AM


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 09:14 AM

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.

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.

;