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 : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

remove horizontal pdf grid border and change background color

Thread ID:

Created:

Updated:

Platform:

Replies:

118745 Apr 7,2015 12:53 AM UTC Apr 7,2015 01:01 PM UTC WinForms 1
loading
Tags: PDF
jb
Asked On April 7, 2015 12:53 AM UTC

I have a pdf document that i am creating using pdf grid and pdf grid row

the document has 20 pdf grid rows

row 1, 2 , 3 has 3 columns and data is placed in them either left or right justified.  I want to remove the top and bottom border and have the 3 grid rows to have a Yellow back ground color. I have not been able to remove the horizontal borders to make it look like a big header grid.

The other rows have 3 columns and i want to remove the top/bottom border on certain rows.



Abirami Selvan [Syncfusion]
Replied On April 7, 2015 01:01 PM UTC

Hi Jb,

 

Thank you for using Syncfusion product.

 

We can set the background color using style.BackgroundBrush property and text can be justified in cell using PdfStringFormat.Alignment .

 

Please refer the below code snippet:

//String format

PdfStringFormat format=new PdfStringFormat();

 

//Alignment the text to right

format.Alignment=PdfTextAlignment.Right;

 

//Apply the background to the first 3 rows

pdfGrid.Rows[i].Style.BackgroundBrush = PdfBrushes.Yellow;

 

//Assign the format to particular cells

pdfGrid.Rows[i].Cells[j].StringFormat = format;

 

//Remove the bottom border for previous row

pdfGrid.Rows[i - 1].Cells[j].Style.Borders.Bottom = PdfPens.Transparent;

 

//Remove the top border from  row

pdfGrid.Rows[i].Cells[j].Style.Borders.Top = PdfPens.Transparent;

 

 

We have attached the sample for removing the grid row top/bottom borders in below link:

http://www.syncfusion.com/downloads/support/directtrac/137404/PdfGridBorderSample-1960878967.zip

 

Please try this and let us know if you have any further assistance .

 

Thanks,

Abirami.


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.

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

;