How to set Text alignment for a specific PDFGrid''s cell?

Hi!

I try to center the Text with the code below; however it does not work.

PdfGrid grid = new PdfGrid();
grid.Columns.Add(3);

PdfGridRow row;



row.Cells[1].Style.Font = new PdfStandardFont(PdfFontFamily.Courier, 20, PdfFontStyle.Bold);

row.Cells[1].Style.StringFormat = new PdfStringFormat(PdfTextAlignment.Center);

row.Cells[1].Value = ("CENTER TEXT");


How do I center a text in a specific cell?

Thanks!


1 Reply

PJ Priyadharshini J Syncfusion Team November 16, 2010 05:30 AM UTC

Hi Kim,

Thank you for your interest in Syncfusion proudcts.

We have placed a sample in the link below to align the text to the center of a specific cell.
forum-785344585.zip

Kindly try this and let us know if you have any queries.

Regards,
Priyadharshini



Loader.
Up arrow icon