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.

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

Thread ID:





84509 Jul 1,2009 01:31 AM Jul 3,2009 09:42 AM Windows Forms 1
Tags: GridControl
Administrator [Syncfusion]
Asked On July 1, 2009 01:31 AM


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

Rajadurai C [Syncfusion]
Replied On July 3, 2009 09:42 AM

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



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.