add toolbar button dynamically

2 posts, 0 answers
  1. Ivy
    Ivy avatar
    30 posts
    Member since:
    Feb 2013

    Posted 21 Sep 2013 Link to this post

    I am struggling to create a toolbar button dynamically. Can someone please help me with this? I would like to create a main toolbar with a set of buttons created inside it. 
  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 21 Sep 2013 Link to this post

    Hi Ivy,

    Please check the following C# code.

    C#:
    EditorToolGroup main = new EditorToolGroup();
    RadEditor1.Tools.Add(main);
     
    EditorTool bold = new EditorTool();
    bold.Name = "Bold";
    bold.ShortCut = "CTRL+B";
    main.Tools.Add(bold);
     
    EditorTool italic = new EditorTool();
    italic.Name = "Italic";
    italic.ShortCut = "CTRL+I";
    main.Tools.Add(italic);
     
    EditorTool underline = new EditorTool();
    underline.Name = "Underline";
    underline.ShortCut = "CTRL+U";
    main.Tools.Add(underline);

    Hope this helps,
    Shinu.
Back to Top