)
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. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Is there a way to have text with different styles in the same table cell?

Platform: WinForms |
Control: PDF |
Published Date: February 4, 2015 |
Last Revised Date: May 14, 2019
Tags: pdf, layer

Is there a way to have text with different styles in the same table cell?

Yes, you can apply different styles to the text in the same table cell. This can be achieved by drawing the texts at the specified positions with different styles using Graphics.

Refer to the following code example to apply styles in cell.

C#

//Add the row and value to the cell
for (int i = 0; i < 10; i++)
{
PdfGridRow pdfGridRow = pdfGrid.Rows.Add();
pdfGridRow.Cells[0].Value = "Syncfusion";
pdfGridRow.Cells[1].Value = "Software";
}
//Apply the font
pdfGrid.Style.Font = new PdfStandardFont(PdfFontFamily.TimesRoman, 14, PdfFontStyle.Regular);
//Draw the string in cell
page.Graphics.DrawString("Software", new PdfStandardFont(PdfFontFamily.TimesRoman, 14F, PdfFontStyle.Bold), PdfBrushes.Black, new PointF(100, 0));
//Draw the Grid
pdfGrid.Draw(page, new PointF(0,0));

Sample link:

http://www.syncfusion.com/downloads/support/directtrac/general/PdfGridSample-593662040.zip

2X faster development

The ultimate WinForms UI toolkit to boost your development speed.
ADD COMMENT
You must log in to leave a comment

Please sign in to access our KB

This page will automatically be redirected to the sign-in page in 10 seconds.

Up arrow icon

Warning Icon 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.Close Icon

Live Chat Icon For mobile
Live Chat Icon