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.

Multiple colored text within an Excel cell

Thread ID:





105609 Nov 5,2012 12:13 PM Nov 6,2012 12:04 AM WPF 1
Tags: XlsIO
Phil Steel
Asked On November 5, 2012 12:13 PM


Is it possible to do multiple colored text within an Excel cell?

So if I have a cell with the value 'Employee John Smith' is it possible to make 'Employee' grey and 'John Smith' red?


Mahajothi R [Syncfusion]
Replied On November 6, 2012 12:04 AM

Hi Phil,


Thank you for your interest in Syncfusion products.


Yes, Our XlsIO support multiple colored text within an excel cell. We have provided the sample with code snippet below for your reference.


Sample : RichTextString.zip


Code Snippet [C#]:


//Insert Rich Text

IRange range = worksheet.Range["C3"];

range.Text = "Employee John Smith";

IRichTextString rtf = range.RichText;


//Formatting the text

IFont fontGray = workbook.CreateFont();

fontGray.Size = 16;

fontGray.Bold = true;

fontGray.Italic = true;

//grey color

fontGray.RGBColor = System.Drawing.Color.FromArgb(255, 192, 192, 192);

rtf.SetFont(0, 7, fontGray);


IFont fontRed = workbook.CreateFont();

fontRed.Size = 12;

fontRed.Bold = false;

fontRed.Italic = false;

//red color

fontRed.RGBColor = System.Drawing.Color.FromArgb(255, 255, 0, 0);

rtf.SetFont(9, 18, fontRed);


Please refer XlsIO Formatting sample in Syncfusion Essential studio dashboard.

Dashboard location : $system drive:\Program Files\Syncfusion\Essential Studio\\Samples\


To know more details on Rich Text please refer this online link : http://help.syncfusion.com/Reporting/XlsIO/WPF


Please let us know if you require any further clarifications.





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.