PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Sun Jun 30, 2024 4:26 pm

All times are UTC


Forum rules


Please read this before posting on this forum: Forum Rules



Post new topic Reply to topic  [ 3 posts ] 
Author Message
PostPosted: Mon Mar 31, 2014 9:43 am 
Offline

Joined: Mon Mar 31, 2014 9:31 am
Posts: 4
Hi All,

I have just started using migradoc recently and I am currently stack with trying to colour a single cell within a table.

The problem I am finding is that the table cell does not get fill with the colour, but simply a strip of that colours is seen on the cell.

I believed this is because it is "setting the shading of the text in the cells - therefore the gap" as Thomas points in this http://forum.pdfsharp.net/viewtopic.php?f=2&t=480. However I still do not know how to fill the entire cell. My rows already have different colours to make reading easier, but i need to be able to set a particular cell with a different colour


Code:
                    cell = row.Cells[1];
                    cell.Borders.ClearAll(); //try playing with borders setting to not avail
                    cell.Borders.Visible = false; //try playing with borders setting to not avail
                    row.Cells[1].Format.Shading.Color = Styles.GetCellColour(can.CarColour);



Any help will be greatly appreciated.

Thanks


Top
 Profile  
Reply with quote  
PostPosted: Mon Mar 31, 2014 12:48 pm 
Offline
PDFsharp Guru
User avatar

Joined: Mon Oct 16, 2006 8:16 am
Posts: 3100
Location: Cologne, Germany
Try "row.Cells[1].Shading.Color" instead of "row.Cells[1].Format.Shading.Color" - the former sets the color of the cell, the latter sets the color of the text background.

_________________
Regards
Thomas Hoevel
PDFsharp Team


Top
 Profile  
Reply with quote  
PostPosted: Wed Apr 02, 2014 2:20 pm 
Offline

Joined: Mon Mar 31, 2014 9:31 am
Posts: 4
Thanks Thomas! I totally missed that, even when I read your previous thread! Sorry


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC


Who is online

Users browsing this forum: Google [Bot] and 69 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Privacy Policy, Data Protection Declaration, Impressum
Powered by phpBB® Forum Software © phpBB Group