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. Image for the cookie policy date

Highlight the text in a cell in a GridGroupingControl

I'd like to highlight the text in a cell when a user clicks on it. Any idea?

Thanks


2 Replies

HT Ha Tran May 7, 2008 03:19 PM UTC

Found the answer, I guess I'd post it here so others could find it later.
gridGroupingControl1.TableControl.Model.Options.ActivateCurrentCellBehavior = GridCellActivateAction.SelectAll;



By the way, this also works for "readonly cells." How do you disable the cursor/carret on a read-only cell?

>I'd like to highlight the text in a cell when a user clicks on it. Any idea?

Thanks





SR Sri Rajan Syncfusion Team May 12, 2008 05:04 PM UTC

Hi,

Thank you for your interest in Syncfusion products.

Please refer the below code to disable the cursor on a read-only cell.


this.gridGroupingControl1.TableControlCurrentCellStartEditing += new GridTableControlCancelEventHandler(gridGroupingControl1_TableControlCurrentCellStartEditing);

void gridGroupingControl1_TableControlCurrentCellStartEditing(object sender, GridTableControlCancelEventArgs e)
{
GridCurrentCell cc = this.gridGroupingControl1.TableControl.CurrentCell;
if (e.TableControl.GetTableViewStyleInfo(cc.RowIndex, cc.ColIndex).ReadOnly)
e.Inner.Cancel = true;
}


Please let me know if this helps,

Best Regards,
Srirajan



Loader.
Live Chat Icon For mobile
Up arrow icon