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

2 posts, 0 answers
  1. Sopan
    Sopan avatar
    34 posts
    Member since:
    May 2012

    Posted 16 Sep 2013 Link to this post

    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);



  2. Boby
    Admin
    Boby avatar
    595 posts

    Posted 18 Sep 2013 Link to this post

    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 >>
  3. UI for WPF is Visual Studio 2017 Ready
Back to Top