PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Mon Apr 23, 2018 5:19 pm

All times are UTC


Forum rules


Please read this before posting on this forum: Forum Rules



Post new topic Reply to topic  [ 2 posts ] 
Author Message
PostPosted: Thu Jan 04, 2018 4:45 pm 
Offline

Joined: Thu Oct 26, 2017 12:00 pm
Posts: 13
Hello PDFSharp / Migradoc, happy new year!

I have a List<Row> with stored well-set rows before adding these to the table.

I want to manage this by simply:

Code:
foreach (Row tableRow in sysrows)
{
   //tableRow.Clone();
   table.Rows.Add(tableRow);
}



But this gives me the exception for not having cloned the row before adding it. When I do clone this row, I get double rows added to the table.

What must I do to have the specific row added once in this matter?

One of the Rows
Code:
 Row systemrow = new Row { BottomPadding = 5 };


Top
 Profile  
Reply with quote  
PostPosted: Thu Jan 04, 2018 6:50 pm 
Offline
User avatar

Joined: Sat Mar 14, 2015 10:15 am
Posts: 356
Location: CCAA
Hi!
MwBakker wrote:
What must I do to have the specific row added once in this matter?
Could be a bug in MigraDoc. Hard to say with just those code snippets.

You say you get double rows. Maybe you try to add the rows twice.
Probably something wrong with the code your are not showing here.

A row created with "new Row()" should have no owner. You should be able to add it once to a table.

Maybe use the Issue Submission Template if you think there is a bug in MigraDoc.
See also:
viewtopic.php?f=2&t=832


The standard way of adding rows is this:
Code:
Row row = table.AddRow();

You can store the Row in a List<Row> for future references.
See also:
http://pdfsharp.net/wiki/HelloMigraDoc-sample.ashx

_________________
Best regards
Thomas
(Freelance Software Developer with several years of MigraDoc/PDFsharp experience)


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

All times are UTC


Who is online

Users browsing this forum: Baidu [Spider], Bing [Bot] and 8 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:  
Powered by phpBB® Forum Software © phpBB Group