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

CommandBarStripElement Items

17 Answers 511 Views
CommandBar
This is a migrated thread and some comments may be shown as answers.
di
Top achievements
Rank 1
di asked on 23 Apr 2015, 07:13 AM

Is there the way to fix the position of some items in CommandBarStripElement so those items are always visible and could not be moved to the overflow.

I guess it is pointless to override OnItemOverflowed as it is already too late, the item already moved to overflow menu. Isn't it?

 

Thanks.

 

17 Answers, 1 is accepted

Sort by
0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 24 Apr 2015, 02:56 PM
Hello Di,

Thank you for writing.

When you shrink the RadCommandBar the items in the CommandBarStripElement get overflowed. Hence, they are placed in the overflow menu. There is not automatic way to prevent a certain item from hiding. However,you can subscribe to the CommandBarStripElement.ItemOutOfOverflow event and insert the hidden item at a previous position in the CommandBarStripElement.Items collection. Thus, the item will be visible. Here is an example how to make the CommandBarDropDownList visible by inserting it at the first position:
private void commandBarStripElement1_ItemOverflowed(object sender, EventArgs e)
{
    CommandBarDropDownList ddl = sender as CommandBarDropDownList;
    if (ddl!=null)
    {
        this.commandBarStripElement1.Items.Remove(ddl);
        this.commandBarStripElement1.Items.Insert(0, ddl);
    }
}

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

See What's Next in App Development. Register for TelerikNEXT.

 
0
di
Top achievements
Rank 1
answered on 28 Apr 2015, 07:13 AM

Hi Dess,

Thanks for your reply, but that solution doesn't fix the issue I am trying to avoid.

I've got two strip elements on the same row and when I start window resize the left strip elements starts hiding buttons first.

I identified the feature which causes this scenario. If the command bar items displayed in runtime exactly as they appeared in design time it all worked fine - the right strip shrinks, then left one continue. But when I change the button text to longer one the left strip starts shrinking first.

Please check the attached RadCommandBarTest sample.(Please rename the attached file to zip)

Please run the project as it is first. Then in Form1.cs OnLoad method uncomment line 49

//radCommandBarToggleButtonItem9.Text = "Modified Button 2";

and run the sample again.

The bottom line - I want to prevent the left-hand strip element from shrinking before the right one.

 

Many Thanks.

0
Accepted
Dess | Tech Support Engineer, Principal
Telerik team
answered on 30 Apr 2015, 01:31 PM
Hello Di,

Thank you for writing back.

When you construct the items in RadCommandBar at design time, the CommandBarStripElement calculates its DesiredLocation considering the items' Text. If you change the text of a certain item from the left strip element to a longer string, the DesiredLocation for the second strip will remain with the previous X value. That is why when you start shrinking the form the second strip element will try to get to its DesiredLocation. The possible solution that I can suggest is to adjust the DesiredLocation of the right strip element after changing the text.
 
protected override void OnLoad(EventArgs e)
{
    base.OnLoad(e);
 
    radCommandBarToggleButtonItem9.Text = "Modified Button 2";
    commandBarStripElement2.DesiredLocation = commandBarStripElement2.Location;
    this.radCommandBarLineElement1.Strips.Remove(this.commandBarStripElement2);
    this.radCommandBarLineElement2.Strips.Add(this.commandBarStripElement2);
}

I hope this information helps. If you have any additional questions, please let me know.
 
Regards,
Dess
Telerik
 

See What's Next in App Development. Register for TelerikNEXT.

 
0
di
Top achievements
Rank 1
answered on 04 May 2015, 12:22 AM

Dess,

That solution works perfectly fine.

Thanks a lot.

0
Ras Ran
Top achievements
Rank 2
Iron
Veteran
Iron
answered on 22 Nov 2018, 05:59 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:53 AM
Hello, Raneesras,

Your question has already been answered in the other thread you have opened on the same topic. Please, see our answer there for more information.
We kindly ask you to use just one thread for a specific problem to contact us. Posting the same questions numerous times slows down our response time because we will need to review and address two or more tickets instead of one. Moreover, threads are handled according to license and time of posting, so if it is an urgent problem, we suggest you use a support ticket, which would be handled before a forum thread.

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.
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
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
Ras Ran
Top achievements
Rank 2
Iron
Veteran
Iron
answered on 23 Nov 2018, 11:24 AM
see this..i need to find the these buttons programatically which is inside of over flow button
0
Ras Ran
Top achievements
Rank 2
Iron
Veteran
Iron
answered on 23 Nov 2018, 11:26 AM
see this
0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 23 Nov 2018, 01:22 PM
Hello, Raneesras, 

According to the provided screenshot, it seems that you are using some custom theme in your application. However, if I understand your requirement correctly from the screenshot, the command bar is shrunk so it doesn't have enough space to fit all the available buttons. You can find below a sample code snippet demonstrating how to access the illustrated CommandBarButtons:



RadCommandBarOverflowPanelElement overflowPanelElement = this.commandBarStripElement1.OverflowButton.DropDownMenu.Items[0] as RadCommandBarOverflowPanelElement;
if (overflowPanelElement != null)
{
    RadCommandBarOverflowPanel overflowPanel = overflowPanelElement.Children[0] as RadCommandBarOverflowPanel;
    foreach (CommandBarButton b in overflowPanel.Children)
    {
        Console.WriteLine(b.Text);
    }
}

I hope this information helps. 

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 30 Nov 2018, 06:18 AM
hii....how to fit rad comman bar button in commandBarStripElement ?? see the attached picture..the last commannar button is under the over flow button how to avoid this...i need ur help
0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 03 Dec 2018, 09:51 AM
Hello, Raneesras,    

According to the provided screenshot, it is not clear enough what is the exact requirement that you are trying to achieve. I suppose that you want to see all items outside the overflow buttons. In order to avoid showing items in the overflow button, you should keep the width of the RadCommandBar greater than the total width of all controls hosted in the strips. It may be suitable to handle the SizeChanged event and adjust the RadCommandBar's size.

If it is not the exact requirement, please specify in details what is the exact goal that you want to accomplish. Thus, we would be able to think about a suitable solution.

I hope this information helps.

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 04 Dec 2018, 11:36 AM

hii.......,

how do i change radcommanbar customize window back color ?is there any way

0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 05 Dec 2018, 07:37 AM
Hello, Raneesras,    

In order to change the color of the CommandBarCustomizeDialog, you can handle the static CommandBarCustomizeDialogProvider.CustomizeDialogOpening event where you have access to the dialog itself:

CommandBarCustomizeDialogProvider.CustomizeDialogOpening+=CommandBarCustomizeDialogProvider_CustomizeDialogOpening;

private void CommandBarCustomizeDialogProvider_CustomizeDialogOpening(object sender, CancelEventArgs e)
{
    CommandBarCustomizeDialog d = sender as CommandBarCustomizeDialog;
    if (d!=null)
    {
        d.BackColor = Color.Red;
    }

Note that you can access the Controls collection in the dialog if you need to customize other controls.

Note that most of the forum threads are reviewed by Telerik representatives and sometimes we address the questions asked by our customers in the forums as well. However, a post in the forum doesn't guarantee you a response from the Telerik support team. Moreover, threads are handled according to license and time of posting, so if you have any further questions, we suggest you use a support ticket, which would be handled before a forum thread.

I hope this information helps.

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 05 Dec 2018, 08:26 AM
thank you so much mr.dess....its worked 
0
Ras Ran
Top achievements
Rank 2
Iron
Veteran
Iron
answered on 05 Dec 2018, 10:50 AM
hello...i wanna change radcommanbar button tooltip font size...is it possible ?
Tags
CommandBar
Asked by
di
Top achievements
Rank 1
Answers by
Dess | Tech Support Engineer, Principal
Telerik team
di
Top achievements
Rank 1
Ras Ran
Top achievements
Rank 2
Iron
Veteran
Iron
Share this question
or