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);
}
After a few hours surfing forum posts (and losing some hair), I've come up with this solution
Drop an HTML Edit control onto an aspx page.
Use the Quicj Design to remove any buttons you dont want, then (still in the QuickDesign" click the "Skins" option on the lefthandside.
Click "Save" - and a "Myskin.xml" will be created on your harddrive (my machione seemed to need to save it to 'C:\Inetpub\wwwroot\aspnet_client\Infragistics\skins')
Copy this xml file from C:\Inetpub\wwwroot\aspnet_client\Infragistics\skins to your web app directory.
In code you can then do :
Dim
HTMLEdit As New Infragistics.WebUI.WebHtmlEditor.WebHtmlEditor
HTMLEdit.LoadSkin(HttpContext.Server.MapPath("MySkin.xml"))
Mycontrol.controls.add(HTMLEdit)
Htmledit then renders with the correct formatting
Thanks for the tip....I used the following:
MyEditor.TabStripDisplay = False
They call it "HtmlBoxTabStrip " Hope that helps.
Does anyone know of a way to remove the "Design / HTML" buttons at the bottom of the editor?
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>