Custom dropdown button

7 posts, 1 answers
  1. Rowen
    Rowen avatar
    13 posts
    Member since:
    Aug 2008

    Posted 14 Aug 2008 Link to this post

    I have been searching for help on creating a custom dropdown/split button in RadEditor for asp.net ajax, to behave similarly to the undo/redo buttons or the insert table button for example.

    Is this possible? If so, how would I get started?

    Thanks,

    Rowen
  2. Rumen
    Admin
    Rumen avatar
    12851 posts

    Posted 15 Aug 2008 Link to this post

    Hi Rowen,

    Please, review the following articles:
    How to create a ToolStrip
    and
    Adding Custom Dropdowns.

    Best regards,
    Rumen
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Rowen
    Rowen avatar
    13 posts
    Member since:
    Aug 2008

    Posted 17 Aug 2008 Link to this post

    Thanks, but neither of these examples are quite what I am looking for. I want a custom dropdown, but instead of having a select box style item in the toolbar with text and a dropdown arrow, I want a split button style icon to drop down the list. Onclick should execute the same tool with different parameters (similar to how InsertCodeSnippet functions I am guessing??).

    Is it possible to get a dropdown tool to render with an icon instead of text?

    The toolstrip can do this, but I don't think it will work for me easily because I am building the drop down list dynamically. Toolstrip appears to require a separate tool to be registered for each item. If I can use multiple copies of a single custom tool, can I register parameters that can be accessed when the tool is executing?

    I thought there might be a straightforward way to do this but have not discovered any yet.

    Regards,

    Rowen

  5. Rumen
    Admin
    Rumen avatar
    12851 posts

    Posted 18 Aug 2008 Link to this post

    Hi Rowen,

    At present, RadEditor for ASP.NET AJAX offers only the demonstrated custom dropdowns in the Adding Custom Dropdowns and How to create a ToolStrip examples.

    The control does not offer currently support for hiding the dropdown header title and replacing it with an icon. This feature is logged in our To-Do list, but I cannot provide an exact estimate when it will be implemented.

    Best regards,
    Rumen
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  6. Rowen
    Rowen avatar
    13 posts
    Member since:
    Aug 2008

    Posted 18 Aug 2008 Link to this post

    Thanks for the information.

    In that case, is there a way to add a custom tool to an editor toolstrip? I tried doing it through the toolsfile.xml:

        <EditorToolStrip Name="Link Options" popupheight="145px">
          <tool name="MyLinkManager" />
          <tool name="LinkManager" />
        </EditorToolStrip>

    resulted in teh error :
    Cannot find a string resource with key 'MyLinkManager' in App_GlobalResources/RadEditor.Tools.resx. Please, make sure that your custom localization has all needed resource strings, or copy the original localization resources from your installation folder to App_GlobalResources.

    I can do it programmatically, but the custom tool  icon will not render in the drop down list (set through css in the same way I do for other custom tools which works... just not on toolstrip).

    This appears to be 2 separate bugs related to the toolstrip?

    Thanks for your help,

    Rowen
  7. Answer
    Rumen
    Admin
    Rumen avatar
    12851 posts

    Posted 19 Aug 2008 Link to this post

    Hi Rowen,

    Straight to the points:
    1. To fix the "Cannot find a string resource with key 'MyLinkManager' in App_GlobalResources/RadEditor.Tools.resx" error open the \App_GlobalResources\RadEditor.Tools.resx (you can import it from the installation folder) and create a new row with name MyLinkManager and the desired value for the MyLinkManager command.
    2. To render icons for the toolstrip and the custom item in it, rename the toolstrip name to LinkOptions in the ToolsFile:

      <tools ...>
          <EditorToolStrip Name="LinkOptions" popupheight="145px">
            <tool name="MyLinkManager" />
            <tool name="LinkManager" />
          </EditorToolStrip>
      ...

      and put the folling classes in the page with the editor:

      <style>
      .rade_toolbar.Default .LinkOptions
      {
         background-image: url(http://www.telerik.com/DEMOS/ASPNET/RadControls/Editor/Skins/Default/buttons/Custom.gif) !important;
      }
      .rade_toolbar.Default .MyLinkManager
      {
         background-image: url(http://www.telerik.com/DEMOS/ASPNET/RadControls/Editor/Skins/Default/buttons/Custom.gif) !important;
      }
      </style>

      If you experience problems with skin different from the default one, just let me know.
    For your convenience I have attached a sample working project.

    Best regards,
    Rumen
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  8. Rowen
    Rowen avatar
    13 posts
    Member since:
    Aug 2008

    Posted 19 Aug 2008 Link to this post

    Excellent, that worked for me.

    Thanks Rumen, very good support
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017