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!
//Create and customize the string formats
PdfStringFormat format = new PdfStringFormat();
format.Alignment = PdfTextAlignment.Center;
//Set the column text format
pdfGrid.Columns[0].Format = format; |
//Create and customize the string formats
PdfStringFormat format = new PdfStringFormat();
format.Alignment = PdfTextAlignment.Center;
for (int i = 0; i < pdfGrid.Columns.Count; i++)
{
//Set the column text format
pdfGrid.Columns[i].Format = format;
} |