Hi Ken,
We don't have direct option to set different background color each column in a PdfLightTable. But we can work around this by using the BeginCellLayout event. In this event we have cell RowIndex and CellIndex properties based on this we can format the column. Please refers to the below code snippet tod
C# static int r = 0,i=10;
void table_BeginCellLayout(object sender, BeginCellLayoutEventArgs args)
{
if ((args.CellIndex) != r)
{
r = 0; i = 10;
}
if (r % 2 != 0)
{
PdfBrush brush = PdfBrushes.Magenta;
args.Graphics.DrawRectangle(brush, args.Bounds);
}
else
{
PdfBrush brush = PdfBrushes.Green;
args.Graphics.DrawRectangle(brush, args.Bounds);
}
r++; i = i + 20;
}
Please refers to the below sample to do so:
'>http://websamples.syncfusion.com//samples/Pdf.Windows/F79491/main.htm">http://websamples.syncfusion.com//samples/Pdf.Windows/F79491/main.htm You can change the sample as per your requirement. Please let me know if this helps you.
Best Regards,
Bhuvana