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

EditModes set to Design displays Preview mode

3 Answers 52 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Mauro
Top achievements
Rank 1
Mauro asked on 28 Jan 2011, 11:10 AM
Hi all,
I'm trying to migrate an application from the old RadEditor Q2 2007 SP1 to the new Ajax Editor Q3 2010.
I'm using VS2010 compiling for the .NET 2.0 framework and IE6+ as a target browser.

I use the editor to allow users to create letters: so far I've managed to get the new Editor to display on the page and display the letters.

The problem is: this application needs to set the Editor to one mode only, either Preview (read only) or Design (editable). It seems to be a pretty simple thing and everything works fine when I set it to read only like this:

Editor.Enabled = false;
Editor.EditModes = EditModes.Preview;

The Editor comes up in read-only preview mode as expected.

But if I set it like this:

Editor.Enabled = true;
Editor.EditModes = EditModes.Design;

The Editor comes up again in read-only preview mode!

But if I set it like this:

Editor.Enabled = true;
Editor.EditModes = EditModes.Design | EditModes.Preview;

It comes up in preview mode but displays the buttons to switch between preview and design, but I have to click the "Preview" button first and then the "Design" button after that to get into design mode and start editing.
Although it kind of works, it's obviously not acceptable: what I need is ONE mode active at a time and no way to switch between modes.

Can anybody please help?
More info: I'm setting the EditModes property in the page_load event handler and using IE8 in compatibility mode for the testing.

Thanks
Mauro
.

3 Answers, 1 is accepted

Sort by
0
Mauro
Top achievements
Rank 1
answered on 28 Jan 2011, 12:26 PM
OK I've found the problem!
Setting the ToolsFile property was causing this and other problems (toolbars not displayed) even after I've removed any reference to the unsupported "dockable" property.

It would be nice to clearly say that this property is no longer supported, instead of keeping it but not working!
0
Mauro
Top achievements
Rank 1
answered on 28 Jan 2011, 02:36 PM
Update #2
I've identified what's wrong with the tools file. This line causes the toolbars to disappear and the Editor to display in preview mode:

<tool name="mycustomtool" ShowIcon="true" ShowText="false" enabled="true"  iconurl="mycustomtool.gif" />

If I remove the "iconurl" property everything works fine, except for the button that doesn't of course display the image we want.

<tool name="mycustomtool" ShowIcon="true" ShowText="false" enabled="true" />

I'll open a separate topic for that.
0
Rumen
Telerik team
answered on 28 Jan 2011, 03:24 PM
Hi Mauro,

The iconUrl property is not supported by RadEditor for ASP.NET AJAX, because its has new toolbar architecture based on image sprites. Using a new client-side model, semantic rendering, and many other innovations such as the use of css image sprites, the new RadEditor delivers minimal and well-formed output. Its new rendering and architecture allows it to be a couple of times faster than the classic ASP.NET Editor.

The only supported way to set an image to a custom tool is to provide image file for it and output the following CSS class in the page with the editor:

<style type="text/css">
.reTool .mycustomtool
{
  background-image: url(MyImage.gif);
}
</style>

Here are two demos that show how to define custom icons for custom tools:
Custom Tools
Custom Dialogs

Kind regards,
Rumen
the Telerik team
Browse the vast support resources we have to jump start 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
Mauro
Top achievements
Rank 1
Answers by
Mauro
Top achievements
Rank 1
Rumen
Telerik team
Share this question
or