No Text Associated

4 posts, 0 answers
  1. Marek
    Marek avatar
    48 posts
    Member since:
    Aug 2005

    Posted 11 Jun 2007 Link to this post

    In the toolstrip item configuration menu item, would it be possible to remove the "No Text Associated" entry for separator items?  They shouldn't really be visible in this context.

    Thanks

    Best regards

    Marek
  2. Boyko Markov
    Admin
    Boyko Markov avatar
    610 posts

    Posted 11 Jun 2007 Link to this post

    Hello Marek,

    The solution is:

    1. To subscribe to the DropDownOpened event by doing the following:
       toolStripItem1.OverflowManager.DropDownButton.DropDownOpened +=new EventHandler(DropDownButton_DropDownOpened);
       
    2. Get access to the menu items in the add/remove menu item by using something similar in the DropDownOpened event handler:

        for (int i = 0; i < (this.toolStripItem1.OverflowManager.DropDownButton.Items[itemsCount - 1] as RadMenuItem).Items.Count; i++)
                  {
                      RadMenuItem item = (this.toolStripItem1.OverflowManager.DropDownButton.Items[itemsCount - 1] as RadMenuItem).Items[i] as RadMenuItem;

                    if (item != null)
                    {
                        // Here you have access to a regular menu Item
                    
                        item.Visibility = ElementVisibility.Collapsed;
                        continue;
                    }

                    RadMenuSeparatorItem separatorItem = (this.toolStripItem1.OverflowManager.DropDownButton.Items[itemsCount - 1] as RadMenuItem).Items[i] as RadMenuSeparatorItem;
                    if (separatorItem != null)
                    {
                        // Here you have access to the separator menu Item
                        separatorItem.Visibility = ElementVisibility.Collapsed;
                        continue;
                    }
                }

    I hope this helps. 
     

    Best wishes,
    Ray
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Marek
    Marek avatar
    48 posts
    Member since:
    Aug 2005

    Posted 12 Jun 2007 Link to this post

    Hi Ray
    Thank you for the workaround, but I would really not expect to have to do this as I can't really see the need to have the separator items available in the Add/Remove buttons child menu - VS certainly doesn't do this.  I don't know whether others agree, but the separators should be filtered out in the base code.  Maybe it could be an additional property for the toostrip/menu strip classes whether to show the separator items or not?

    Best regards

    Marek
  5. Boyko Markov
    Admin
    Boyko Markov avatar
    610 posts

    Posted 12 Jun 2007 Link to this post

    Hello Marek,

    At present we do not have an additional property whether to show or not the separators. Nevertheless, your feedback is very constructive and I think that such a property will be helpful not only for separators. We could apply the same logic to items in the toolStripItem that we want to always be visible, and which could not be removed by the overflow menu. What do you think about that idea? I think that we will manage to add this functionality in one of the next versions.

    I'm looking forward to your reply.
      

    Kind regards,
    Ray
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
Back to Top