changing cell color

Technical support for Spire.PDF

Moderator: iceblue support

changing cell color

Postby zmathew » Mon May 28, 2012 1:29 am

Hi,

I am using Spire PDF to print a grid to pdf. I there a way to change the color of certain cells in a pdf instead of coloring entire rows ?

Zac.
zmathew
 
Posts: 2
Joined: Tue Dec 20, 2011 4:57 pm

Re: changing cell color

Postby guestbook » Wed May 30, 2012 8:53 am

Hi Zac,

Thanks for your inquiry. I am glad to inform you that Spire.PDF enables users to change the color of the specific cells

with two lines of code:

//set color of certain cells
grid.Rows[0].Cells[1].Style.BackgroundBrush = PdfBrushes.Green;
grid.Rows[0].Cells[3].Style.BackgroundBrush = PdfBrushes.Red;

I also attach a live demo to provide more detail relate to this issue. Please have a check.

Though this works smoothly on my side, yet if there is any doubt or any new problem that troubles you, please feel

free to contact me at anytime, I will try my best to help you to solve it as soon as possible. Have a nice day.

Best Regards
Eric
e-iceblue support
You do not have the required permissions to view the files attached to this post.
guestbook
 
Posts: 2
Joined: Tue May 01, 2012 10:36 am


Return to Spire.PDF

Who is online

Users browsing this forum: No registered users and 1 guest