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

Table column widths not preserved with RTF round trip

5 Answers 205 Views
RichTextBox
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Brian Sayatovic
Top achievements
Rank 1
Brian Sayatovic asked on 16 May 2012, 03:43 PM
We're using Silverlight Controls 2012 Q1 (2012.1.0215.1050).  Our RichTextBox is used to edit and save RTF content to our database.  Upon creating a table with specific widths, it looks OK in the editor before save (see TablesBefore.png).  But when we re-load the same content, the column widths of the table are reverted to being equal widths (see TablesAfter.png).

I've tried setting the widths via dragging the column dividers, using the properties dialog to set them in pixels, and using the properties dialog to set them in percents.  None of these approaches work after re-loading the file.

I did notice that if I copy the contents to the clipboard, and later paste into a reverted document, the pasted content does preserve the column widths of a pasted table.

I have not yet grabbed the bytes out of the database to save to a file to determine if it is a problem with save or load.

In searching these forums, I found several similar issues reported for HTML import/export, etc.; however, while those are all claimed to be resolved, none seemed to apply to my problem which -- through direct observation -- is not resolved.

5 Answers, 1 is accepted

Sort by
0
Brian Sayatovic
Top achievements
Rank 1
answered on 16 May 2012, 03:50 PM
I grabbed the bytes out of our database and saved them as an *.rtf file, and loaded it into Microsoft Word.  Word shows the tables with their appropriate widths (see RichTextBoxRtfTablesLoadedInWord.png).  This suggests it is not a save problem, but a load problem. 
0
Brian Sayatovic
Top achievements
Rank 1
answered on 16 May 2012, 03:55 PM
I can't attach the *.rtf file; blocked by forums.  However, it's small, so here's its raw content:

{\rtf\ansi\ansicpg1252\uc1\deff0\deflang1033{\fonttbl{\f0 Verdana;}}{\colortbl\red0\green0\blue0 ;\red255\green255\blue255 ;\red0\green0\blue0 ;}{\*\defchp\ltrch\fs24\i0\b0\strike0\ulnone}{\*\defpap\fs24\sl276\slmult1\sa180}{\stylesheet{\*\ts2\tsrowd\sqformat\trbrdrt\brdrs\brdrw15\brdrcf0\trbrdrb\brdrs\brdrw15\brdrcf0\trbrdrl\brdrs\brdrw15\brdrcf0\trbrdrr\brdrs\brdrw15\brdrcf0\trbrdrh\brdrs\brdrw15\brdrcf0\trbrdrv\brdrs\brdrw15\brdrcf0\trgaph0\clpadft3\clpadt75\clpadfr3\clpadr75\clpadfl3\clpadl0\clpadfb3\clpadb0\tsvertalt\ltrch\fs24\i0\b0\strike0\ulnone\fs24\sl276\slmult1\sa180 TableNormal;}{\*\ts3\tsrowd\sqformat\trbrdrt\brdrs\brdrw15\brdrcf0\trbrdrb\brdrs\brdrw15\brdrcf0\trbrdrl\brdrs\brdrw15\brdrcf0\trbrdrr\brdrs\brdrw15\brdrcf0\trbrdrh\brdrs\brdrw15\brdrcf0\trbrdrv\brdrs\brdrw15\brdrcf0\trgaph0\clpadft3\clpadt75\clpadfr3\clpadr75\clpadfl3\clpadl0\clpadfb3\clpadb0\tsvertalt\ltrch\fs24\i0\b0\strike0\ulnone\fs24\sl240\slmult1 TableGrid;}}\nouicompat\viewkind4\paperw12240\paperh15840\margl1425\margr1425\margt1425\margb1425\deftab720\sectd\pgwsxn12240\pghsxn15840\marglsxn1425\margrsxn1425\margtsxn1425\margbsxn1425\headery720\footery720\pard\ltrpar\fs24\sl276\slmult1\sa180{\ltrch\i0\b0\strike0\ulnone}\par{\pard\yts3\ltrpar\intbl\itap1\fs24\sl240\slmult1{\ltrch\i0\b0\strike0\ulnone 1"}\cell\pard\yts3\ltrpar\intbl\itap1\fs24\sl240\slmult1{\ltrch\i0\b0\strike0\ulnone 2"}\cell\pard\yts3\ltrpar\intbl\itap1\fs24\sl240\slmult1{\ltrch\i0\b0\strike0\ulnone 3"}\cell\pard\yts3\ltrpar\intbl\itap1\fs24\sl240\slmult1{\ltrch\i0\b0\strike0\ulnone 4"}\cell\trowd\irow0\irowband0\ts3\ltrrow\trgaph0\trbrdrt\brdrs\brdrw15\brdrcf0\trbrdrb\brdrs\brdrw15\brdrcf0\trbrdrl\brdrs\brdrw15\brdrcf0\trbrdrr\brdrs\brdrw15\brdrcf0\trbrdrh\brdrs\brdrw15\brdrcf0\trbrdrv\brdrs\brdrw15\brdrcf0\trwWidth5000\trftsWidth2\clvertalt\clbrdrt\brdrs\brdrw15\brdrcf0\clbrdrb\brdrs\brdrw15\brdrcf0\clbrdrl\brdrs\brdrw15\brdrcf0\clbrdrr\brdrs\brdrw15\brdrcf0\clpadft3\clpadt75\clpadfr3\clpadr75\clpadfl3\clpadl0\clpadfb3\clpadb0\cellx1410\clvertalt\clbrdrt\brdrs\brdrw15\brdrcf0\clbrdrb\brdrs\brdrw15\brdrcf0\clbrdrl\brdrs\brdrw15\brdrcf0\clbrdrr\brdrs\brdrw15\brdrcf0\clpadft3\clpadt75\clpadfr3\clpadr75\clpadfl3\clpadl0\clpadfb3\clpadb0\cellx4290\clvertalt\clbrdrt\brdrs\brdrw15\brdrcf0\clbrdrb\brdrs\brdrw15\brdrcf0\clbrdrl\brdrs\brdrw15\brdrcf0\clbrdrr\brdrs\brdrw15\brdrcf0\clpadft3\clpadt75\clpadfr3\clpadr75\clpadfl3\clpadl0\clpadfb3\clpadb0\cellx8595\clvertalt\clbrdrt\brdrs\brdrw15\brdrcf0\clbrdrb\brdrs\brdrw15\brdrcf0\clbrdrl\brdrs\brdrw15\brdrcf0\clbrdrr\brdrs\brdrw15\brdrcf0\clpadft3\clpadt75\clpadfr3\clpadr75\clpadfl3\clpadl0\clpadfb3\clpadb0\cellx14460\row\pard\yts3\ltrpar\intbl\itap1\fs24\sl240\slmult1{\ltrch\i0\b0\strike0\ulnone A}\cell\pard\yts3\ltrpar\intbl\itap1\fs24\sl240\slmult1{\ltrch\i0\b0\strike0\ulnone B}\cell\pard\yts3\ltrpar\intbl\itap1\fs24\sl240\slmult1{\ltrch\i0\b0\strike0\ulnone C}\cell\pard\yts3\ltrpar\intbl\itap1\fs24\sl240\slmult1{\ltrch\i0\b0\strike0\ulnone D}\cell\trowd\irow1\irowband1\ts3\ltrrow\lastrow\trgaph0\trbrdrt\brdrs\brdrw15\brdrcf0\trbrdrb\brdrs\brdrw15\brdrcf0\trbrdrl\brdrs\brdrw15\brdrcf0\trbrdrr\brdrs\brdrw15\brdrcf0\trbrdrh\brdrs\brdrw15\brdrcf0\trbrdrv\brdrs\brdrw15\brdrcf0\trwWidth5000\trftsWidth2\clvertalt\clbrdrt\brdrs\brdrw15\brdrcf0\clbrdrb\brdrs\brdrw15\brdrcf0\clbrdrl\brdrs\brdrw15\brdrcf0\clbrdrr\brdrs\brdrw15\brdrcf0\clpadft3\clpadt75\clpadfr3\clpadr75\clpadfl3\clpadl0\clpadfb3\clpadb0\cellx1410\clvertalt\clbrdrt\brdrs\brdrw15\brdrcf0\clbrdrb\brdrs\brdrw15\brdrcf0\clbrdrl\brdrs\brdrw15\brdrcf0\clbrdrr\brdrs\brdrw15\brdrcf0\clpadft3\clpadt75\clpadfr3\clpadr75\clpadfl3\clpadl0\clpadfb3\clpadb0\cellx4290\clvertalt\clbrdrt\brdrs\brdrw15\brdrcf0\clbrdrb\brdrs\brdrw15\brdrcf0\clbrdrl\brdrs\brdrw15\brdrcf0\clbrdrr\brdrs\brdrw15\brdrcf0\clpadft3\clpadt75\clpadfr3\clpadr75\clpadfl3\clpadl0\clpadfb3\clpadb0\cellx8595\clvertalt\clbrdrt\brdrs\brdrw15\brdrcf0\clbrdrb\brdrs\brdrw15\brdrcf0\clbrdrl\brdrs\brdrw15\brdrcf0\clbrdrr\brdrs\brdrw15\brdrcf0\clpadft3\clpadt75\clpadfr3\clpadr75\clpadfl3\clpadl0\clpadfb3\clpadb0\cellx14460\row}\pard\ltrpar\fs24\sl276\slmult1\sa180{\ltrch\i0\b0\strike0\ulnone}\par}
0
Alex
Telerik team
answered on 21 May 2012, 12:50 PM
Hello,

Thanks for bringing this issue to our attention. It is indeed a problem when loading the document. The reason that the column widths are not accurately imported is that we rely on the \clwWidth and \clftsWidth RTF tags to be able to read the exact width of the imported cells. Most RTF editors do export this control words when creating RTF files containing tables. However, this is not the case.
It should be possible to reconstruct the correct layout of the table using only the \cellx control words which are present in the document you've sent, but currently we don't support this. We will add this to our to do list, however I cannot give you exact timeline of when this will be implemented. 
Please don't hesitate to contact us again if you have more questions.

Greetings,
Alex
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
Brian Sayatovic
Top achievements
Rank 1
answered on 21 May 2012, 01:08 PM
To be clear, the RTF which I provided came from the RichTextBox.  So the missing \clwWidth and \clftsWidth are missing because the RichTextBox did not export them.  I'd be perfectly happy in the short-term if the RichTextBox could export these values so that a round trip was reliable (that is the user experience our users are presently frustrated by).
0
Alex
Telerik team
answered on 24 May 2012, 01:19 PM
Hello,

Indeed the table cell width tags are not exported in some cases. However we managed to fix the issue and the fix will be included in the Q2 2012 release which will be out in the first half of June.

Thank you again for your feedback.

All the best,
Alex
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

Tags
RichTextBox
Asked by
Brian Sayatovic
Top achievements
Rank 1
Answers by
Brian Sayatovic
Top achievements
Rank 1
Alex
Telerik team
Share this question
or