Bug when Table is next to table

4 posts, 0 answers
  1. David
    David avatar
    1 posts
    Member since:
    Mar 2013

    Posted 10 Aug 2014 Link to this post

    Hello,

        When creating a raddocument, if you create a table add it, then create another table right after it, the expected functionality is not there.  Using the sample code found at "http://www.telerik.com/help/wpf/radrichtextbox-features-document-elements-tables.html", moving the creating of the table to a function and then doing the following causes the program to select more than desired.

    RadDocument document = new RadDocument();
    Section section = new Section();
                
    section.Blocks.Add(new Paragraph());
    section.Blocks.Add(CreateTable());
    section.Blocks.Add(CreateTable());
    section.Blocks.Add(new Paragraph());
    document.Sections.Add(section);

    radRichTextBox1.Document = document;

    Now if I hover over the second table, and press the "select all" icon that appear in the upper left hand corner, it will select the table as expected, and the last row of the previous table. 

    Since the RadDocument does not support list indenting, before I go to print a document, I have to fake it out by creating a bunch of tables/paragraphs to create this functionality.  So a document that has lets say, 100 tables, if you click in the upper left hand corner, it will crash the program either right away giving a cannot convert error, or after freezing it will wait a bit and then run out of memory.

    The above functionality is negated of course if I insert a paragraph in-between tables, however that is not the desired functionality and kind of a waste of resources.

    So is there anyway to ensure the grid cannot have the "Select All" icon appear?  If not, is there anything I can do other than inserting something in-between the tables?  If I do have to insert something in-between the tables, is a Paragraph my best bet?

    Thanks and Kind Regards,



  2. Aylin
    Admin
    Aylin avatar
    75 posts

    Posted 14 Aug 2014 Link to this post

    Hello David,

    Thank you for contacting us.

    Indeed when several tables are added with no paragraphs between the tables the described behavior is observed. This is a limitation of the current implementation of the document model. When adding two tables through the UI we have ensured that a paragraph is added between the tables.

    To workaround the issue it is recommended to add paragraph between tables as implemented in the built-in UI.

    Regarding the crash of the program, I tried to add 100 tables/paragraphs in the document, however I could not reproduce a crash or out of memory exception.

    Let me know if that helps. In the meantime I will try to check if TabStops could be used to achieve the desired functionality and get back to you later.

    Regards,
    Aylin
    Telerik
     
    Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
     
  3. UI for WPF is Visual Studio 2017 Ready
  4. Aylin
    Admin
    Aylin avatar
    75 posts

    Posted 26 Aug 2014 Link to this post

    Hi David,

    This is a follow up of my latest post. 

    TabStop functionality is appropriate for text indenting in lists. However it works fine when the list item's text is one line long. When the text is multiple lines long, then the desired alignment cannot be achieved.

    There is an approach that could be used when the text it too long. However after exporting and opening the document content in MS Word we hit a known issue - an extra tab is added. This leads to dislocation of the text compared to the original document in RadRichTextBox.

    That being said, we would suggest sticking to tables to achieve the desired result. As to the extra space added by the paragraphs, you can work around this by setting small values for the FontSize and SpacingAfter properties of those paragraphs:
    section.Blocks.Add(new Paragraph() { FontSize = 0, SpacingAfter = 0 });
    section.Blocks.Add(CreateTable());
    section.Blocks.Add(new Paragraph() { FontSize = 0, SpacingAfter = 0 });

    Regards,
    Aylin
    Telerik
     
    Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
     
  5. C
    C avatar
    43 posts
    Member since:
    Jul 2014

    Posted 01 Oct 2014 in reply to Aylin Link to this post

    This bug is also affecting us.  We need to create a table next to another table because RadDocument does not support creating a horizontal divider line.

    Horizontal line thread
    http://www.telerik.com/forums/raddocument-wpf---how-to-programatically-create-horizontal-line
Back to Top