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. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

pdfgrid only border outside

Thread ID:

Created:

Updated:

Platform:

Replies:

150401 Jan 6,2020 07:13 AM UTC Jan 7,2020 01:08 PM UTC WPF 1
loading
Tags: PDF
Judith
Asked On January 6, 2020 07:13 AM UTC

I will create a Table in a PDF with Borders only outside


  PdfGrid  tabelle = new PdfGrid();
            tabelle.Style.BorderOverlapStyle = PdfBorders
            PdfGridRow row1 = tabelle.Rows.Add();
            PdfGridRow row2 = tabelle.Rows.Add();

            tabelle.Columns.Add(1);
            PdfGridCellStyle pdfGridCellStyle = new PdfGridCellStyle();
                      
            //pdfGridCellStyle.Borders.Top = PdfPens.Black;
            //pdfGridCellStyle.Borders.Bottom = PdfPens.transparent;
            PdfGridCell pdfGridCell = tabelle.Rows[0].Cells[0];
            pdfGridCell.Style = pdfGridCellStyle;
            pdfGridCellStyle.Borders.Top = PdfPens.transparent;
            pdfGridCellStyle.Borders.Bottom = PdfPens.black;
             pdfGridCell = tabelle.Rows[1].Cells[0];
            pdfGridCell.Style = pdfGridCellStyle;
tabelle.Draw(page, new PointF(x, y+20));

Sowmiya Loganathan [Syncfusion]
Replied On January 7, 2020 01:08 PM UTC

Hi Judith,  

Thank you for contacting Syncfusion support.  

We can achieve your requirement by hiding some borders of PdfGridCell with use of PdfCellStyle. Please refer the below code snippet for more details,  

//Specify the style for PdfGridCell 
PdfGridCellStyle cellStyle = new PdfGridCellStyle(); 
cellStyle.Borders.Bottom.Color = new PdfColor(Color.Transparent); 
 
//Apply cell style 
PdfGridCell cell = pdfGrid.Rows[0].Cells[0]; 
cell.Style = cellStyle; 

We have created the sample to achieve your requirement. Please find the same from below, 

Please try the sample in your end and let us know if you need any further assistance on this.  

Regards, 
Sowmiya Loganathan 



CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon