|
//Create an instance of PdfGridRowStyle
PdfGridRowStyle pdfGridRowStyle = new PdfGridRowStyle();
pdfGridRowStyle.Font = new PdfStandardFont(PdfFontFamily.Courier, 15, PdfFontStyle.Bold);
//Set style for the PdfGridRow
pdfGrid.Rows[0].Style = pdfGridRowStyle; |
|
//Specify the style for the PdfGridCell
PdfGridCellStyle pdfGridCellStyle = new PdfGridCellStyle();
pdfGridCellStyle.Font = new PdfStandardFont(PdfFontFamily.TimesRoman, 20, PdfFontStyle.Italic);
//Apply style
PdfGridCell pdfGridCell = pdfGrid.Rows[1].Cells[0];
pdfGridCell.Style = pdfGridCellStyle; |
|
private static void PdfGrid_BeginCellLayout(object sender, PdfGridBeginCellLayoutEventArgs args)
{
//Change the font style for Column 1
if(!args.IsHeaderRow && args.CellIndex==1)
{
args.Style.Font = new PdfStandardFont(PdfFontFamily.TimesRoman, 0, PdfFontStyle.Underline);
}
} |