Intersoft Support Center

Show Toolbar at Runtime

In WebTextEditor, it is possible to hide certain toolbars onload and show them at runtime using the context menu. Simply set the Visible property of the toolbar that you want to hide in InitializeToolBar server side event.

In this topic, you will learn how to show Toolbar at runtime.

To show Toolbar at runtime

  1. Right-click on WebTextEditor control and choose Properties.
  2. Set EnableContextMenu to True.
  3. Expand ToolBarSettings and set ToolBarMode to Complete.
  4. Hide standard toolbar using InitializeToolBar server-side event.
    C# Copy ImageCopy Code
    protected void WebTextEditor1_InitializeToolBar(object sender, WebTextEditorToolBarArgs e)
       WebTextEditorToolBarCollection toolbars = e.ToolBar as WebTextEditorToolBarCollection;
       WebTextEditorToolBar tb = toolbars.GetNamedItem(WebTextEditor1.ID + "_tbStandard");
       if (tb != null)
          tb.Visible = false;

  5. Run the project. In this case, only Formatting toolbar is shown on load. Note that the commands included in Standard toolbar are not initially shown on load. Try to right click on header area and choose Standard options in context menu to show the Standard toolbar.
Previous Next