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 set Text alignment for a specific PDFGrid''s cell?

Thread ID:

Created:

Updated:

Platform:

Replies:

97291 Nov 15,2010 08:25 AM Nov 17,2010 06:29 AM ASP.NET Web Forms (Classic) 3
loading
Tags: PDF
kim
Asked On November 15, 2010 08:25 AM

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!


Priyadharshini J [Syncfusion]
Replied On November 16, 2010 12:34 AM

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



kim
Replied On November 16, 2010 11:04 AM

Hi Priyadharshini!

Thanks, for quick response!

Followed your example, I just changed the code below:

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

TO:

row.Cells[1].StringFormat.Alignment = PdfTextAlignment.Center;

and it is working.

Thanks!


Selvakumar P [Syncfusion]
Replied On November 17, 2010 06:29 AM

Hi Kim,

Thank you for your response.we are glad hear that it is working good.

Regards,
Selvakumar.





CONFIRMATION

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.

;