Mike Fleischauer
Top achievements
Rank 1
Mike Fleischauer
asked on 17 Jul 2009, 08:00 PM
This is a two part problem, with the interaction between RadGrid and RadEditor.
I am using (Q1) RadEditor inside a RadGrid. I have encountered a bit of a problem. When the user enters newlines within the editor, it renders them as <BR> instead of the proper <BR />. I generally wouldn't care. Unfortunatly, later when I do a call to RadGrid->ExportToPdf() I get the following exception:
Invalid XHTML. RadGrid has to render correct XHTML in order to export to PDF.
If you edit the Grid item to not contain any newlines it works correctly. Add a new return in the editor and export will break again.
So, I either need RadEditor to render properly formatted HTML, or I need Rad Grid to be less strict in its HTML parsing. Personally, I actually view this as a bug in both products as RadEditor should encode newlines as <BR /> instead of <BR> and RadGrid's export to PDF should be able to handle this situation.
Is there a workaround?
I am using (Q1) RadEditor inside a RadGrid. I have encountered a bit of a problem. When the user enters newlines within the editor, it renders them as <BR> instead of the proper <BR />. I generally wouldn't care. Unfortunatly, later when I do a call to RadGrid->ExportToPdf() I get the following exception:
Invalid XHTML. RadGrid has to render correct XHTML in order to export to PDF.
Parse error:
The 'br' start tag on line 688 does not match the end tag of 'div'. Line 688, position 268.
at line:
<span id="ctl00_BodyPlaceHolder_RadGrid1_ctl00_ctl04_Label2">In lists granted to other people, you currently can't see the thumbnails without permission.<div><br><div>Add a check in file loader for ListPermission exception.</div></div></span>
If you edit the Grid item to not contain any newlines it works correctly. Add a new return in the editor and export will break again.
So, I either need RadEditor to render properly formatted HTML, or I need Rad Grid to be less strict in its HTML parsing. Personally, I actually view this as a bug in both products as RadEditor should encode newlines as <BR /> instead of <BR> and RadGrid's export to PDF should be able to handle this situation.
Is there a workaround?
7 Answers, 1 is accepted
0
Hello Mike,
You should not experience this problem, because RadEditor for ASP.NET AJAX produces XHTML compliant content and the editor inserts <br/> tags on enter key press. Are you able to insert <br> tags when typing in the editor in the following live example: Column Types?
For your convenience I have attached a video demonstrating my test.
Sincerely yours,
Rumen
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
You should not experience this problem, because RadEditor for ASP.NET AJAX produces XHTML compliant content and the editor inserts <br/> tags on enter key press. Are you able to insert <br> tags when typing in the editor in the following live example: Column Types?
For your convenience I have attached a video demonstrating my test.
Sincerely yours,
Rumen
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Josep
Top achievements
Rank 1
answered on 04 Aug 2009, 12:35 PM
Hello,
Currently we have a similar problem with chrome browser, when press enter, the editor adds <div><br/></div> instead of <br/>.
Do you know how we can solve it?
Thanks for all.
0
Hello Josep,
This is the behavior of the Safari/Chrome browser's rich-text engine. It is not identical to the IE/FF/Opera implementations and we have already logged this for implementation for the coming Q3 2009. At this point there is no way to change this behavior easily.
Best regards,
Tervel
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
This is the behavior of the Safari/Chrome browser's rich-text engine. It is not identical to the IE/FF/Opera implementations and we have already logged this for implementation for the coming Q3 2009. At this point there is no way to change this behavior easily.
Best regards,
Tervel
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Josep
Top achievements
Rank 1
answered on 07 Aug 2009, 08:15 AM
Hello,
Ok, We wait for the next version.
Thanks for all.
Avanzis.
0
Timothy Stanton
Top achievements
Rank 1
answered on 23 Nov 2009, 03:12 PM
I am seeing the exact same problem in IE7. I am not sure this is only a safari issue
0
Mike Fleischauer
Top achievements
Rank 1
answered on 23 Nov 2009, 06:02 PM
@Timothy Stanton, I agree, we experienced the problem across all browsers we test on ( the big 5 ), it is not specific to the browser. As I said in my original post, it was the generated html from the rad editor and the parsing of that html by the RadGrid. If we set a breakpoint and manually reformed <br> to <br />, everything worked fine.
In the end, we just gave up on this feature ( export to pdf ) and use a PDF library we already had access to. Would be nice to see this resolved anyways.
In the end, we just gave up on this feature ( export to pdf ) and use a PDF library we already had access to. Would be nice to see this resolved anyways.
0
Abhijit
Top achievements
Rank 1
answered on 24 Oct 2017, 05:23 PM
SOLVED: I came across a similar problem. I had BR tags inside of SPAN tags. I changed the SPAN tags with DIV tags but it had no effect.
NOTE that I am using Kendo PDF Export and not RAD Grid but this should work for you too.
Then I compared this with a similar issue with another part of the page. The only difference was P tags. So I replaced my HTML:
<div>content<br/>content</div>
with
<div><p>content<br/>content</p></div>
and I don't see the error anymore.
Thanks,
Abhijit
