Id like the editor to load in preview mode. Currently the default is design mode and I cant see any way to change this.
Can anyone advice how to do this?
Just to be clear I want the design mode to still be availble to users...I just want is to open in the preview mode.
Many Thanks, Des
Can anyone advice how to do this?
Just to be clear I want the design mode to still be availble to users...I just want is to open in the preview mode.
Many Thanks, Des
5 Answers, 1 is accepted
0
Hi Des,
You can load the editor in the Preview mode on page load with this code:
If you don't like the Design and HTML modes, you can load the editor in Preveiw mode by setting the EditModes property to Preview, e.g.
<telerik:RadEditor ID="RadEditor1" EditModes="Preview" runat="server"></telerik:RadEditor>
Best regards,
Rumen
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
You can load the editor in the Preview mode on page load with this code:
<telerik:RadEditor runat=
"server"
ID=
"RadEditor1"
OnClientLoad=
"OnClientLoad"
>
<Content>Sample Content</Content>
</telerik:RadEditor>
<script type=
"text/javascript"
>
function
OnClientLoad(editor, args) {
setTimeout(
function
()
{
editor.set_mode(4);
}, 100);
}
</script>
If you don't like the Design and HTML modes, you can load the editor in Preveiw mode by setting the EditModes property to Preview, e.g.
<telerik:RadEditor ID="RadEditor1" EditModes="Preview" runat="server"></telerik:RadEditor>
Best regards,
Rumen
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0

Timothy Kruszewski
Top achievements
Rank 1
answered on 03 Nov 2010, 05:40 PM
How can this be done server side via C# code? Or better yet we store a cookie with the setting of HTML or DESIGN and when the page loads the editor should have the HTML view or DESIGN view selected but all tabs(Design, Html and Preview) should still be available for selection.
Thanks
Thanks
0
Hi Timothy ,
All the best,
Rumen
the Telerik team
You can set RadEditor in Preview mode only on the client side. In order to achieve your scenario you should import the provided JavaScript code using one of the server-side methods: Page.RegisterStartupScript or Page.RegisterClientScriptBlock.
More information is available in this blog post: Executing JavaScript function from server-side code.All the best,
Rumen
the Telerik team
Do you want to have your say when we set our development plans?
Do you want to know when a feature you care about is added or when a bug fixed?
Explore the
Telerik Public Issue Tracking
system and vote to affect the priority of the items
0

Timothy Kruszewski
Top achievements
Rank 1
answered on 04 Nov 2010, 09:52 PM
Could you please show me a C# code sample?
0
Hi Timothy,
Sure, here is the C# code:
Regards,
Rumen
the Telerik team
Sure, here is the C# code:
protected
void
Page_Load(
object
sender, EventArgs e)
{
RadEditor1.OnClientLoad =
"OnClientLoad"
;
string
js = @"
<script language=
'javascript'
>
function OnClientLoad(editor, args) {
setTimeout(function()
{
editor.set_mode(4);
}, 100);
}
</script>";
ClientScript.RegisterClientScriptBlock(
this
.GetType(),
"myscriptkey"
, js);
}
Regards,
Rumen
the Telerik team
Do you want to have your say when we set our development plans?
Do you want to know when a feature you care about is added or when a bug fixed?
Explore the
Telerik Public Issue Tracking
system and vote to affect the priority of the items