Hi Jonathan,
Thank you for your interest in Syncfusion Products.
We can able to export datagridview to PdfLightTable, and setting of the column width is mentioned in the attached sample. For finding the maximum width of the column we have to manually calculate the size of each row(value) in the column and find the maximum width of the column. Please refer this and let us know if you have any concern.
Thanks,
Karthikeyan.C
Hi Jonathan,
Thank you for your information.
We can able to achieve your requirement by using Grid Control. Instead of using DataGridView and manually convert to PDF document, Grid control will automatically export your grid to the PDF document with the styles and String Format. I have attached a sample for using grid control, please let us know if this meets your requirements or let us know if you have any concern.
Thanks,
Karthikeyan.C
Hi Jonathan,
Thank you for your update.
We can set the width of the column of the DataGridView, however as DataGridView is in pixels we have to convert to points, please use the below code snippet.
PdfUnitConvertor unitConv = new PdfUnitConvertor();
tblPDF.Columns[0].Width = unitConv.ConvertFromPixels(dataGridView1.Columns[0].Width+100, PdfGraphicsUnit.Point);
If there is enough space present is a single page then the PdfLightTable will draw within a Page, or else it will automatically paginate to the next page. And the text within the row will wrap automatically.
Please let us know if you have any concern.
Thanks,
Karthikeyan.C