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

HTMLEditorColumn using old renderer?

4 Answers 86 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Steele
Top achievements
Rank 1
Steele asked on 17 Nov 2010, 12:12 AM
Hi All,
The HTML rendered out by the radgrid HTMLEditorColumn is NOT the same as that render in the Editor proper. It seems there are a few discrepencies which point to an old renderer being used.
In the HTMLEditorColumn
Line breaks rendered as <BR>
Changes in fonts are rendered as <font ...> font blocks
In the Editor proper
Line breaks rendered as <br />
Changes in fonts are rendered as <span style='font...> span blocks.

Is there a reason for this?  I am having a lot of trouble getting consistency in my rendering layouts because of this. Not to mention having to implement work-arounds to get XHTML compliance for exporting to PDF.
Before I get involved in changing my framework to use and Editor in a templated column, I would like to know if this is a bug or something that is expected.

Thanks,
Steele.

4 Answers, 1 is accepted

Sort by
0
Steele
Top achievements
Rank 1
answered on 17 Nov 2010, 12:46 AM
Further, the problem seems to be confined to when the grid is in EditMode inline.
** EDIT **
This is not the case - I have the issue still with Form Edit.
0
Steele
Top achievements
Rank 1
answered on 17 Nov 2010, 01:26 AM
I finally have the steps to replicate this issue!
  1. Create a grid with a bound HTMLEditorColumn
  2. In the ItemDataBound event of the Grid, access the column editor as a RadEditor.
protected void rgElements_ItemDataBound(object sender, GridItemEventArgs e)
        {
            if (e.Item is GridEditableItem && e.Item.IsInEditMode)
            {
                // sort out the Editor
                RadEditor re = null;
                if (rgElements.MasterTableView.EditMode == GridEditMode.InPlace)
                {
                    GridDataItem gdi = e.Item as GridDataItem;
                    re = (RadEditor)gdi["Notes"].Controls[0];
  
                                    }
                else
                {
                    re = (RadEditor)((GridEditableItem)e.Item)["Notes"].Controls[0];
                    re.Width = Unit.Percentage(100);
                }
  
                re.ToolbarMode = EditorToolbarMode.Default;
                    re.ContentFilters = EditorFilters.RemoveScripts;
                    re.EditModes = EditModes.All; // EditModes.Design;
                    re.StripFormattingOptions = EditorStripFormattingOptions.NoneSupressCleanMessage | EditorStripFormattingOptions.MSWord;
                    re.ToolsFile = "../Config/HTMLEditorToolsBasic.xml";
  
                  
                            }
        }

The HTML generated by the column is now using old tags (<BR> and <FONT>).
A weird one!
Thanks,
Steele.
0
Steele
Top achievements
Rank 1
answered on 18 Nov 2010, 12:32 AM
The key line in the above script is :

re.ContentFilters = 

 

EditorFilters.RemoveScripts;

 

If I use

re.ContentFilters =

 

EditorFilters.DefaultFilters | EditorFilters.RemoveScripts;

 

instead, the outputs return to normal.
0
Dobromir
Telerik team
answered on 18 Nov 2010, 10:07 AM
Hi Steele,

This is the expected behavior of RadEditor. By design, RadEditor has enabled various content filters, which are responsible for the XHTML compliant output.

More detailed information regarding RadEditor's content filters is available in the following help article and live demo:
Content Filters
Editor / Built-in Content Filters

Kind regards,
Dobromir
the Telerik team
Browse the vast support resources we have to jumpstart your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
Tags
Editor
Asked by
Steele
Top achievements
Rank 1
Answers by
Steele
Top achievements
Rank 1
Dobromir
Telerik team
Share this question
or