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 : Nov 16th 2018).
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?

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

Article ID: Published Date: Last Revised Date: Platform: Control:
3730 02/04/2015 02/04/2015 WinForms PDF
Tags:
Did you find this information helpful?
Add Comment
You must log in to leave a comment

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