This is a migrated thread and some comments may be shown as answers.

{"'0' is not a valid value for property 'LineHeight'."}

1 Answer 132 Views
RichTextBox
This is a migrated thread and some comments may be shown as answers.
Sopan
Top achievements
Rank 1
Sopan asked on 16 Sep 2013, 11:37 AM
Hi,

I am trying to dynamically add table to the RadRichTextBox so I have written following code


Code Executed successfully, but while reflecting this code to document error following message shown

{"'0' is not a valid value for property 'LineHeight'."}

I am not able to get LineHeight property from which class. How to set it.

Please Help

Thanks
Sopan Vaidya
Table ttable = new Table();
                                ttable.Style = MyTableStyle;
 
                                var TabRowColl = TableRowHelpCollection.Where(x => x.ParentTableId == item.ElementKey).ToList();
                                foreach (var TR in TabRowColl)
                                {
                                    TableRow TBLR = new TableRow();
                                    TBLR.Height = 10;
                                     
//                                    TBLR.Style = MyRowStyle;
                                    foreach (var TC in TR.TableCellCollection)
                                    {
                                        TableCell TBLC = new TableCell();
                                         
                                        //TBLC.Style = new StyleDefinition ();
                                        foreach (var CB in TC.CellDocumentCollection)
                                        {
 
                                            if (CB is Paragraph)
                                            {
                                                Paragraph PP = new Paragraph();
                                                 
                                                foreach (var Child in CB.Children)
                                                {
                                                    if (Child is Span)
                                                    {
                                                        Span Spn = new Span((Child as Span).Text);
                                                         
                                                        PP.Children.Add(Spn);
                                                    }
                                                    else if (Child is ImageInline)
                                                    {
 
                                                    }
                                                }
                                                TBLC.Children.Add(PP);
                                            }
                                            else if (CB is Table)
                                            {
 
                                            }
                                        }
                                        TBLR.Cells.Add(TBLC);
                                    }
                                    ttable.Rows.Add(TBLR);
                                }
 
                                CurrentSelectedSection.Children.AddAfter(CurrPara, ttable);



1 Answer, 1 is accepted

Sort by
0
Boby
Telerik team
answered on 18 Sep 2013, 06:30 AM
Hi Sopan,
Using the document model in such way (using Children collections and AddBefore/AddAfter) is dangerous; can easily produce invalid documents and is no longer recommended (actually we are thinking of good way to deprecate this API). Instead, you can use RadDocumentEditor class, which guarantees that the document will always be in a valid state.

Regards,
Boby
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
Tags
RichTextBox
Asked by
Sopan
Top achievements
Rank 1
Answers by
Boby
Telerik team
Share this question
or