I have a Infragistics.Document.RichText.TableNode object, for which i need to set Settings on a column level , to extend the width property.
And this table is being associated as the content of the richtexteditor
Snippet of code used:
if (error == null) { foreach (TableRowNode trn in tn.ChildNodes) { cCol = 0; foreach (TableCellNode tcn in trn.ChildNodes) { ParagraphNode pn = tcn.ChildNodes[0] as ParagraphNode; textNode = new TextNode(); textNode.Text = dt.Rows[cRow][cCol].ToString(); rn = new RunNode(); if(cRow == 3 && cCol >=2 & cCol <= 11) rn.Settings = new CharacterSettings() {Bold = true, }; rn.ChildNodes.Add(textNode); pn.ChildNodes.Add(rn); //pn.SetText(dt.Rows[cRow][cCol].ToString()); cCol++; } cRow++; } }
Hello Sowmya,
Thank you for posting.
You can set the table column width by using ‘PreferredWidth’ property off the tableSettings. Like this:
tcn.Settings.PreferredWidth = new TableExtent(200d, TableExtentUnitType.Twip);
Please let me know if you need further assistance.
Sincerely,Divya JainAssociate Software Developer
is tcn an object of type TableSettings or tabelCellSettings, in both cases, width can be set only at the table level, or at a particular cell of a table. Once you let me know what type is tcn, i can try that out
Hello,
It is the instance of the TableCellNode .Just put this line of code into your foreach loop and try it out.
I tried the same and its not working
I increased it from 1200 twp to 3000 twp, now i can see the difference.
Also related to the tablenode, i would like to apply ColumnSpan on particular 2 columns of Row2. However, when applied, the cellnodes are getting increased by this, how can this be done?
Each row has 12 columns , and for Row2 , i woudl liek to apply columnspan for Column 2 which spans across 4 columns ,and also on 10th column which spans across 2 columns.
Hello ,
Thank you for the update.
For column span you can try ‘ ColumnSpan’ property of the table cell.
Here is the list of all the public methods available for table cell which you can use:
https://www.infragistics.com/help/wpf/infragisticswpf.documents.richtextdocument~infragistics.documents.richtext.tablecellsettings_members
Sincerely,
Divya Jain
Associate Software Developer