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

RAD editor not getting disabled when it is within a Panel

1 Answer 143 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Sachidananda
Top achievements
Rank 1
Sachidananda asked on 27 Jul 2011, 10:27 AM
I have a server side Panel and the Rad editor is within the panel.

Now when I try to disable the panel the Rad editor also should get disabled along woth other controls in the panel.

But RAD editor is not disabled ,but allows the user to edit the text.

The code is as follows.

 

<asp:Panel ID="pnlReqeuster" runat="server" CssClass="panel">

 

 

        <asp:Panel ID="pnlInterfaceDetails" runat="server" CssClass="panel" BorderColor="white">

 

                

                <

 

telerik:RadEditor MaxHtmlLength="8000" ID="txtDescription" runat="server" ToolsFile="../App_Data/ToolsFile.xml">

 

 

                </telerik:RadEditor>

 


 

        </asp:Panel>

 

 

</asp:Panel>

 

In thr code behind we give

pnlReqeuster.enabled =false and this should disable the rad editor but it is not getting disabled.
The screenshot of editor after the panel is disabled is attached.

Please help.

1 Answer, 1 is accepted

Sort by
0
Rumen
Telerik team
answered on 01 Aug 2011, 08:04 AM
Hi Sachidananda,

Please, note that the Enabled="false" property of the Asp:Panel control disables only the native ASP.NET controls placed in it. This property is not automatically applied to the RadEditor control and for this reason it stays enabled.

To disable RadEditor you need to set its Enabled property to false. Note that when the Enabled property of RadEditor is set to false, then the editor is rendered as a standard DIV element on the page and its content is loaded in this DIV.

If you would like to disable the editor without hiding its tools, modules and content area then you should do that on the client using the editor.enableEditing(false) method. Here is an example:

<telerik:RadEditor runat="server" ID="RadEditor1">
<Content>some test content</Content>
</telerik:RadEditor>
<input type="button" onclick="toggleEditing();return false;" value="Toggle editing" />
<script type="text/javascript">
var toggle = true;
function toggleEditing()
{
  var editor = $find("<%=RadEditor1.ClientID%>");
  toggle = !toggle;
  editor.enableEditing(toggle);
  editor.set_editable(toggle);
  if (toggle == false) editor.get_document().body.style.backgroundColor = "gray";
  else editor.get_document().body.style.backgroundColor = "";
}
</script>

This is the only way to disable the editor without hiding its toolbars and content area.


All the best,
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
Sachidananda
Top achievements
Rank 1
Answers by
Rumen
Telerik team
Share this question
or