CommandBarStripElement Items

17 posts, 1 answers
  1. di
    di avatar
    7 posts
    Member since:
    Feb 2011

    Posted 23 Apr 2015 Link to this post

    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.

     

  2. Dess | Tech Support Engineer, Sr.
    Admin
    Dess | Tech Support Engineer, Sr.  avatar
    3451 posts

    Posted 24 Apr 2015 Link to this post

    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.

     
  3. di
    di avatar
    7 posts
    Member since:
    Feb 2011

    Posted 28 Apr 2015 in reply to Dess | Tech Support Engineer, Sr. Link to this post

    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.

  4. Answer
    Dess | Tech Support Engineer, Sr.
    Admin
    Dess | Tech Support Engineer, Sr.  avatar
    3451 posts

    Posted 30 Apr 2015 Link to this post

    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.

     
  5. di
    di avatar
    7 posts
    Member since:
    Feb 2011

    Posted 03 May 2015 in reply to Dess | Tech Support Engineer, Sr. Link to this post

    Dess,

    That solution works perfectly fine.

    Thanks a lot.

  6. ranees
    ranees avatar
    118 posts
    Member since:
    Nov 2018

    Posted 21 Nov 2018 Link to this post

    how do i get RadCommandBar CommandBarStripElement items in inside of overflow button ? is there any way 
  7. Dess | Tech Support Engineer, Sr.
    Admin
    Dess | Tech Support Engineer, Sr.  avatar
    3451 posts

    Posted 22 Nov 2018 Link to this post

    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.
  8. ranees
    ranees avatar
    118 posts
    Member since:
    Nov 2018

    Posted 23 Nov 2018 in reply to Dess | Tech Support Engineer, Sr. Link to this post

    hello the radcomman bar item is radcommanbar button and the button is inside of over flow button....how can i find these buttons programatically ??
  9. ranees
    ranees avatar
    118 posts
    Member since:
    Nov 2018

    Posted 23 Nov 2018 in reply to Dess | Tech Support Engineer, Sr. Link to this post

    hello the radcomman bar item is radcommanbar button and the button is inside of over flow button....how can i find these buttons programatically ??
  10. ranees
    ranees avatar
    118 posts
    Member since:
    Nov 2018

    Posted 23 Nov 2018 in reply to ranees Link to this post

    see this..i need to find the these buttons programatically which is inside of over flow button
  11. ranees
    ranees avatar
    118 posts
    Member since:
    Nov 2018

    Posted 23 Nov 2018 Link to this post

    see this
  12. Dess | Tech Support Engineer, Sr.
    Admin
    Dess | Tech Support Engineer, Sr.  avatar
    3451 posts

    Posted 23 Nov 2018 Link to this post

    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.
  13. ranees
    ranees avatar
    118 posts
    Member since:
    Nov 2018

    Posted 30 Nov 2018 Link to this post

    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
  14. Dess | Tech Support Engineer, Sr.
    Admin
    Dess | Tech Support Engineer, Sr.  avatar
    3451 posts

    Posted 03 Dec 2018 Link to this post

    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.
  15. ranees
    ranees avatar
    118 posts
    Member since:
    Nov 2018

    Posted 04 Dec 2018 Link to this post

    hii.......,

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

  16. Dess | Tech Support Engineer, Sr.
    Admin
    Dess | Tech Support Engineer, Sr.  avatar
    3451 posts

    Posted 05 Dec 2018 Link to this post

    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.
  17. ranees
    ranees avatar
    118 posts
    Member since:
    Nov 2018

    Posted 05 Dec 2018 in reply to Dess | Tech Support Engineer, Sr. Link to this post

    thank you so much mr.dess....its worked 
  18. ranees
    ranees avatar
    118 posts
    Member since:
    Nov 2018

    Posted 05 Dec 2018 Link to this post

    hello...i wanna change radcommanbar button tooltip font size...is it possible ?
Back to Top