We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

PDFLightTable border style

Hi,

Could you help us with these question please

Do you know how to manage a border style (Color,width , type..) in a PDFLightTable ?

and how to remove a cell's bottom border as well ?

Many thanks for your help

Florian

3 Replies

PH Praveenkumar H Syncfusion Team November 25, 2013 05:38 AM UTC

Hi Clery,

Thank you for using syncfusion products,

We can manage the border style using the PdfLightTableStyle.
        PdfLightTable table=new PdfLightTable();
        table.Style.BorderPen = borderPen;
        table.Style.BorderPen = borderPen;
        table.Style.CellPadding = 2;
        table.Columns[1].Width = 12;
Please refer the following link for sample.

http://asp.syncfusion.com/demos/reporting/pdf/tables/northwindreport/cs/Default.aspx

Please let us know if you need further assistance.

With Regards,
Praveen


BR Bradley September 22, 2020 10:19 AM UTC

Hi sample Link Currently does not work can you update.


SL Sowmiya Loganathan Syncfusion Team September 23, 2020 12:16 PM UTC

Hi Bradley,   
  
Thank you for contacting Syncfusion support.   
  
We can able to add border style like Color, Width, type, etc. in PdfLightTable. Please find the details from below,  
  
Border color   
Please refer the below code snippet to set the border color. We can able to set the style for all cell or alternative cells.   
  
//Declare and define the default style    
PdfCellStyle cellStyle = new PdfCellStyle();  
  
cellStyle.BorderPen = newPdfPen(Color.Red);  
  
  
Border width   
We can able to set the border width usingPdfPen. Please refer the below code snippet,  
  
//Declare and define the default style.  
PdfCellStyle cellStyle = new PdfCellStyle();  
cellStyle.BorderPen = newPdfPen(Color.Red, 3);  
  
pdfLightTable.Style.DefaultStyle = cellStyle;  
  
  
Border style   
Please refer the below code to set the border style,   
  
//Declare and define the default style  
PdfCellStyle cellStyle = new PdfCellStyle();  
  
cellStyle.BorderPen.DashStyle = PdfDashStyle.DashDotDot;  
  
  
Remove cell bottom border   
We could not able to remove particular cell or all cell bottom border usingPdfLightTable. But we can able to remove all the border. Please refer the below KB for more details,   
  
However, this can be achieved by usingPdfGrid. Please refer the below UG documentation,   
  
  
We have created the sample to illustrate this and please find the download link from below,   
  
Please try the above solution in your end and let us know the result.   
  
Regards,  
Sowmiya Loganathan  
 


Loader.
Live Chat Icon For mobile
Up arrow icon