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
close icon

How to access the richTextBox.SelectionColor property in essential grid cells

Hi

I want a particular cell in my grid to have texts in multiple colors, for that i need to access the richtextbox selectioncolor property. How do i access it when the only object i get is grid control

1 Reply

RC Rajadurai C Syncfusion Team July 3, 2009 01:42 PM UTC

Hi Natasha,

Thanks for your interest in Syncfusion Products.

To access the SelectionColor property of the specific richtextcelltype cell in grid, you can handle its renderer through the MouseDown event. Please refer to the following code.

private void gridControl1_MouseDown(object sender, MouseEventArgs e)
{
int row, col;
this.gridControl1.PointToRowCol(new Point(e.X, e.Y), out row, out col);
if (gridControl1[row, col].CellType == "RichText")
{
GridCurrentCell cc = this.gridControl1.CurrentCell;
GridRichTextBoxCellRenderer rtr = cc.Renderer as GridRichTextBoxCellRenderer;
RichTextBox richText = rtr.Control as RichTextBox;
//access properties for the specific cell
}
}


Regards,
Rajadurai

Loader.
Live Chat Icon For mobile
Up arrow icon