After adding table via Code behind is not reflected to RadDocument ?

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

    Posted 28 Aug 2013 Link to this post

    Hi,

    I have tried for dynamically add table to the RadDocument on RadDocumentDoubleClickEvent written in code behind file then also table is not reflected to the RadDocument. When I scrolled RadDocment then it reflected, how to add the dynamically table or any inline in element to RadDocument ?.

    for reference my code is here
    editor.Document.CaretPosition.MoveToPreviousInline();
    var currpara = editor.Document.CaretPosition.GetCurrentParagraphBox().AssociatedParagraph;
    var atable=ExpandedColl.Where(x=>x.Key==spanbox.Tag).FirstOrDefault().Value;
    if(atable!=null)
    {
      currsect.Blocks.AddAfter(currpara, atable);
    }
  2. Anna
    Admin
    Anna avatar
    99 posts

    Posted 30 Aug 2013 Link to this post

    Hello Sopan,

    Judging by your code it seems you might be trying to use the AddAfter() method on an already measured document (one that has already been visualized in the RadRichtextBox). This may cause various issues so it is not recommended.

    The recommended approach is to use the InsertTable() method of RadRichTextBox (or RadDocumentEditor in case you are not actually showing the document to the user) instead.

    Of course, if you have any concerns or meet any difficulties implementing this approach, please, don't hesitate to get back to us.

    Regards,
    Anna
    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