Hello,
I am adding a WebHtmlEditor dynamically through code to a web page. By default, all the buttons in the toolbar seem to be available. How (through code) do I remove buttons I do not want?
Thanks
Hi Elylcas,
you can delete the tools via the following line of code:
WebHtmlEditor1.Toolbar.Items.RemoveAt ,Remove or RemoveRange.
Here is a help link to removing tools
http://help.infragistics.com/Help/NetAdvantage/NET/2008.1/CLR2.0/html/WebHtmlEditor_Remove_Toolbar_Buttons_of_WebHtmlEditor.html
Here is a help link to the API :
http://help.infragistics.com/Help/NetAdvantage/NET/2008.1/CLR2.0/html/Infragistics2.WebUI.WebHtmlEditor.v8.1~Infragistics.WebUI.WebHtmlEditor.WebHtmlEditor_members.html
Here is a help link for the Remove methods.
http://help.infragistics.com/Help/NetAdvantage/NET/2008.1/CLR2.0/html/Infragistics2.WebUI.WebHtmlEditor.v8.1~Infragistics.WebUI.WebHtmlEditor.ToolbarItemCollection_members.html
Thanks for the reply.
Unfortunately, this is not working for me. I have pasted my code below. The html editor is still rendered with both the bold and insert flash buttons:
protected void Page_Load(object sender, EventArgs e)
{
WebHtmlEditor editor;
editor = new Infragistics.WebUI.WebHtmlEditor.WebHtmlEditor();
editor.Toolbar.Items.Remove(ToolbarItemType.InsertFlash);
editor.Toolbar.Items.Remove(ToolbarItemType.Bold);
this.Controls.Add(editor);
}
Was there a response to this?
I am encountering the same problem.
Thanks, Crile
I was unable to remove the buttons through code, but was able to through the html source. Here, I only add the toolbars I want to see:
<ig_edit:WebHtmlEditor Width="95%" ID="txtEdit" SpellCheckerID="igSpellCheck" runat="server"> <Toolbar> <ig_edit:ToolbarButton Type="Bold" runat="server" /> <ig_edit:ToolbarButton Type="Italic" runat="server" /> <ig_edit:ToolbarButton Type="Underline" runat="server" /> <ig_edit:ToolbarImage Type="Separator" runat="server" /> <ig_edit:ToolbarButton Type="JustifyLeft" runat="server" /> <ig_edit:ToolbarButton Type="JustifyCenter" runat="server" /> <ig_edit:ToolbarButton Type="JustifyRight" runat="server" /> <ig_edit:ToolbarImage Type="Separator" runat="server" /> <ig_edit:ToolbarButton Type="UnorderedList" runat="server" /> <ig_edit:ToolbarButton Type="OrderedList" runat="server" /> <ig_edit:ToolbarImage Type="Separator" runat="server" /> <ig_edit:ToolbarButton Type="Outdent" runat="server" /> <ig_edit:ToolbarButton Type="Indent" runat="server" /> <ig_edit:ToolbarImage Type="Separator" runat="server" /> <ig_edit:ToolbarButton Type="SpellCheck" runat="server" /> </Toolbar></ig_edit:WebHtmlEditor>
Does anyone know of a way to remove the "Design / HTML" buttons at the bottom of the editor?
Thanks for the tip....I used the following:
MyEditor.TabStripDisplay = False
They call it "HtmlBoxTabStrip " Hope that helps.