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

OverflowButton

13 Answers 373 Views
CommandBar
This is a migrated thread and some comments may be shown as answers.
Joe Sugden
Top achievements
Rank 1
Joe Sugden asked on 09 Dec 2010, 04:57 PM
Hello,

We are wondering how to hide the "Add Or Remove Buttons" option when you click the overflow button on a strip of the command bar. We don't want to allow the user to be messing around with what buttons they see. Alternatively, if that option can not be hidden, how to make individual buttons not be present in the menu for show/hide. Note that we don't want to hide the OverlowButton as a whole cause if they make the form narrow they wont have a way to get to the buttons on the right that are now going to be hidden.

See attached screenshot.

Thanks in advance.

13 Answers, 1 is accepted

Sort by
0
Richard Slade
Top achievements
Rank 2
answered on 09 Dec 2010, 05:22 PM
Hi Joe,

If you want to get rid of the overflow menu, but still want to keep the overflow button, you can use the following code:
AddHandler Me.CommandBarStripElement1.OverflowButton.OverflowMenuOpening, AddressOf OverflowMenu_Opening


Private Sub OverflowMenu_Opening(ByVal sender As Object, ByVal e As CancelEventArgs)
    e.Cancel = True
End Sub

However, the only purpose of the overflow button is to show the overflow menu as far as I'm aware, and therefore it may be better to get rid of the overflow button alltogether in the following way
Me.CommandBarStripElement1.OverflowButton.Visibility = ElementVisibility.Collapsed


hope this helps but let me know if you need more information
Richard
0
Joe Sugden
Top achievements
Rank 1
answered on 09 Dec 2010, 06:00 PM
Hello Richard,

What you are suggesting is disabling the whole overflow menu altogether, what we would like to do is keep the ability to show hidden buttons caused by the form being too narrow, and hide the "Add or Remove Buttons" option only, see new screenshot.

Thanks
0
Accepted
Richard Slade
Top achievements
Rank 2
answered on 09 Dec 2010, 06:33 PM
Hi Joe,

This isn't behaving how I was expecting, but here is what I have so far which may help, though it's not complete yet as it leaves the space for the menu text and removes the text. I'll keep looking for you

AddHandler Me.CommandBarStripElement1.OverflowButton.DropDownMenu.DropDownOpened, AddressOf DropDown_Opened

Private Sub DropDown_Opened(ByVal sender As Object, ByVal e As EventArgs)
    For Each item As Object In Me.CommandBarStripElement1.OverflowButton.DropDownMenu.Items
        If TypeOf item Is RadMenuItemBase Then
            If String.Equals("Add or Remove Buttons", CType(item, RadMenuItemBase).Text) Then
                CType(item, RadMenuItemBase).Visibility = ElementVisibility.Collapsed
            End If
        End If
    Next
End Sub

richard
0
Joe Sugden
Top achievements
Rank 1
answered on 09 Dec 2010, 11:15 PM
That helps, thanks!
0
Accepted
Ivan Todorov
Telerik team
answered on 11 Dec 2010, 03:00 PM
Hello Joe,

Thank you for writing.

You can force individual buttons not to be present in the menu for show/hide by setting their VisibleInOverflowMenu property to false. Hiding the "Add or remove buttons" menu item currently can be achieved only in the way that Richard posted. More extended customization options will be released with the upcoming service pack.

Joe, I hope this will help you. If you have any further questions, do not hesitate to ask.

Richard, thank you very much for the help. Your Telerik points have been updated.

Greetings,
Ivan Todorov
the Telerik team
Get started with RadControls for WinForms with numerous videos and detailed documentation.
0
Manoj
Top achievements
Rank 1
answered on 16 Feb 2017, 06:04 AM

I am using CommandBarStripElement, but I am not able to set the 'Text' property for it. I guess because of this, I am not able to see the desired structure in overflow button.
Is this is a bug or am i missing something in it?
UI with old control - Overflow button - old version.png -> (This is what we need to achieve with new version)
UI with new control - Overflow button - new version.png

Please suggest

Thanks Manoj
0
Manoj
Top achievements
Rank 1
answered on 17 Feb 2017, 05:16 AM
Please reply
0
Manoj
Top achievements
Rank 1
answered on 17 Feb 2017, 05:17 AM
Please reply
0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 17 Feb 2017, 08:44 AM
Hello Manoj,

Thank you for writing.  

Here is a sample code snippet demonstrating how to change the text of the overflow menu items:
private void AddRemoveButtonsMenuItem_DropDownOpened(object sender, EventArgs e)
{
    for (int i = 0; i < this.commandBarStripElement1.OverflowButton.AddRemoveButtonsMenuItem.Items.Count; i++)
    {
        RadCommandBarOverflowMenuItem item = this.commandBarStripElement1.OverflowButton.AddRemoveButtonsMenuItem.Items[i] as RadCommandBarOverflowMenuItem;
        item.Text = "My text" + i;
    }
}

Additional information for the overflow button is available here: http://docs.telerik.com/devtools/winforms/commandbar/how-to/customize-the-overflow-button

I hope this information helps. Should you have further questions I would be glad to help.

Regards,
Dess
Telerik by Progress
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
Ras Ran
Top achievements
Rank 2
Iron
Veteran
Iron
answered on 22 Nov 2018, 06:25 AM
how do i get RadCommandBar CommandBarStripElement items in inside of overflow button ? is there any way 
0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 22 Nov 2018, 11:51 AM
Hello, Raneesras, 

You can get the items in the overflow button by iterating the CommandBarStripElement.OverflowButton.AddRemoveButtonsMenuItem.Items collection. As it is demonstrated in the previous reply, they have to be accessed in the OverflowButton.AddRemoveButtonsMenuItem.DropDownOpened event if you need to customize them..

If you are still experiencing any further difficulties, please give us some more details about the exact requirement that you are trying to achieve. Thus, we would be able to think about a suitable solution and assist you further.

Regards,
Dess | Tech Support Engineer, Sr.
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
Ras Ran
Top achievements
Rank 2
Iron
Veteran
Iron
answered on 23 Nov 2018, 10:24 AM
hello the radcomman bar item is radcommanbar button and the button is inside of over flow button....how can i find these buttons programatically ??
0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 23 Nov 2018, 01:24 PM
Hello, Raneesras, 

I would kindly ask you to continue the communication in the other thread in order to avoid duplicated replies in the forum.

Thank you for your understanding.

Regards,
Dess | Tech Support Engineer, Sr.
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
CommandBar
Asked by
Joe Sugden
Top achievements
Rank 1
Answers by
Richard Slade
Top achievements
Rank 2
Joe Sugden
Top achievements
Rank 1
Ivan Todorov
Telerik team
Manoj
Top achievements
Rank 1
Dess | Tech Support Engineer, Principal
Telerik team
Ras Ran
Top achievements
Rank 2
Iron
Veteran
Iron
Share this question
or