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.
Up arrow icon