Hi Anders,
Thank you for using Syncfusion products,
We can achieve your requirement by setting the ShowHeader property as true. Please refer the below code snippet,
//Create a PdfLightTable.
PdfLightTable pdfLightTable = new PdfLightTable();
//Set the header value
pdfLightTable.Style.ShowHeader = true;
//Set the Data source as direct.
pdfLightTable.DataSourceType = PdfLightTableDataSourceType.TableDirect;
pdfLightTable.AllowRowBreakAcrossPages = true;
//Create columns.
pdfLightTable.Columns.Add(new PdfColumn("Name"));
pdfLightTable.Columns.Add(new PdfColumn("Age"));
pdfLightTable.Columns.Add(new PdfColumn("Class"));
//Add rows.
pdfLightTable.Rows.Add(new object[] { "Tet column", "Maxim", "III" });
//Draw the PdfLightTable.
pdfLightTable.Draw(tablePage, PointF.Empty);
|
Please let us know if you need further assistance.
Regards,
Bhuvaneswari N.