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

Bug when Table is next to table

3 Answers 69 Views
RichTextBox
This is a migrated thread and some comments may be shown as answers.
David
Top achievements
Rank 1
David asked on 11 Aug 2014, 01:24 AM
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,



3 Answers, 1 is accepted

Sort by
0
Aylin
Telerik team
answered on 14 Aug 2014, 06:02 AM
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.
 
0
Aylin
Telerik team
answered on 26 Aug 2014, 10:38 AM
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.
 
0
C
Top achievements
Rank 1
answered on 01 Oct 2014, 10:24 PM
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
Tags
RichTextBox
Asked by
David
Top achievements
Rank 1
Answers by
Aylin
Telerik team
C
Top achievements
Rank 1
Share this question
or