Hello all,
How to disable CKeditor when row of GridView its not in edit mode using C# ASP.NET
I am using CKEditor in my web application on the GridView and need to disable/enable the editor from javascript.
If the row of gridview is not in edit mode I need disable the editor else I need enable the editor.
I know that there is an option called readOnly and I have tried using config.js.
CKEDITOR.editorConfig = function (config) {
config.removePlugins = 'bidi,image,forms,adobeair,devtools,find,maximize,a11yhelp,about,divarea,liststyle,tabletools,tableresize,contextmenu,codemirror,docprops,preview,smiley,sourcearea,save,flash,iframe,tabletools,templates,showblocks,newpage,language,print,div';
config.width = '700';
config.height = '200';
config.readOnly = true;
};
But when the row of the GridView is not in edit mode it remains the possibility to write in the editor even if it is not possible to save the text
Does anybody know how to disable and enable back the CKEditor please?
<asp:TemplateField HeaderText="Editor"
ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:TextBox ID="tx1"
runat="server"
TextMode="MultiLine"
Text='<%# Eval("tValue").ToString().Contains("base64") ?
HttpUtility.HtmlDecode(Eval("tValue").ToString()) :
HttpUtility.HtmlDecode(Eval("tValue").ToString()) %>'
CssClass="ckeditor"></asp:TextBox>
<script type="text/javascript">
window.onload = function () {
CKEDITOR.replace('tx1');
}
</script>
</ItemTemplate>
</asp:TemplateField>