This is a migrated thread and some comments may be shown as answers.

No Text Associated

3 Answers 61 Views
Toolstrip (obsolete as of Q3 2010)
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Marek
Top achievements
Rank 1
Marek asked on 11 Jun 2007, 10:27 AM
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

3 Answers, 1 is accepted

Sort by
0
Boyko Markov
Telerik team
answered on 11 Jun 2007, 04:25 PM
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
0
Marek
Top achievements
Rank 1
answered on 12 Jun 2007, 07:38 AM
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
0
Boyko Markov
Telerik team
answered on 12 Jun 2007, 02:31 PM
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
Tags
Toolstrip (obsolete as of Q3 2010)
Asked by
Marek
Top achievements
Rank 1
Answers by
Boyko Markov
Telerik team
Marek
Top achievements
Rank 1
Share this question
or