Add Table to FlowDocument In Code Behind

Posted by urema on Stack Overflow See other posts from Stack Overflow or by urema
Published on 2010-05-12T15:31:44Z Indexed on 2010/05/12 15:34 UTC
Read the original article Hit count: 774

Filed under:
|
|
|
|

Hi,

I have tried this.....

_doc = new FlowDocument();

Table t = new Table();
for (int i = 0; i < 7; i++)
{
    t.Columns.Add(new TableColumn());
}

TableRow row = new TableRow();
row.Background = Brushes.Silver;
row.FontSize = 40;
row.FontWeight = FontWeights.Bold;

row.Cells.Add(new TableCell(new Paragraph(new Run("I span 7 columns"))));
row.Cells[0].ColumnSpan = 6;

_doc2.Blocks.Add(t);

But everytime I go to view this document the table never shows.....although the border image and document title that I add to this document before adding this table outputs fine.

Thanks in advance,

U.

© Stack Overflow or respective owner

Related posts about flowdocument

Related posts about wpf