Collapse QuickToolbar Items

6 posts, 0 answers
  1. David DeLella
    David DeLella avatar
    3 posts
    Member since:
    Jul 2008

    Posted 18 Jul 2008 Link to this post

    Is there a way, using Q4 2006 to collapse the whole QuickAccessToolbar or items within it?  Apparently the properties of items within the menu can not have the visibility property set to Collapse like the chunks.  The hide would work except it doesnt actually hide the item, it leave a blank space where it would go and it still is available on the drop down arrow at the end of the toolbar.  Here is the example I am trying to accomplish:

    Making a developer tool which needs to log in to a database.  Once logged in I will show all the necessary ribbon chunks which contain tools.   I also want a Disconnect button.  The orb menu is a good place but I do not like the way it looks compared to the chunks so I want it on the QuickAccessToolbar.  I can not show or hide the Disconnect button based on the users status.

    Any suggestions?
  2. Nikolay
    Admin
    Nikolay avatar
    1803 posts

    Posted 21 Jul 2008 Link to this post

    Hello David DeLella,

    You are right. You cannot set the Visibility property of the button elements in the RadQuickAccessToolBar to Collapsed. Even if this was possible, when the button is "Collapsed", the correct behavior is still to have an associated item shown in the drop down menu.

    However, there is an approach which will lead to the desired results. I have demonstrated it in the sample project attached. Please notice that you have to clear the Items collection of the drop down menu, so to have it synchronized with the buttons visible in the quick access toolbar.

    If you have additional questions, feel free to contact me.

    All the best,
    Nikolay
    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. David DeLella
    David DeLella avatar
    3 posts
    Member since:
    Jul 2008

    Posted 21 Jul 2008 Link to this post

    I also found a work around similar to yours but discovered another bug in the process.  The work around I used involved creating the RadButton in the form designer code as a global element so I did not have to create it multiple times and I could use the Resources object to load an image.  I then used remove and add features of the QuickAccessToolbar to hide and show.

    The new bug was with standard chunks.  If the initial chunk is set to collapsed by default the ribbon menu for that chunk is still visible when the application loads.  Example is for a login screen.  Hiding all chunks except Help before login.  After login showing all.  The only fix is to make Help the first chunk or do the dynamic add/remove like the QuickAccessToolbar.
  5. Nikolay
    Admin
    Nikolay avatar
    1803 posts

    Posted 25 Jul 2008 Link to this post

    Hi David DeLella,

    I am not quite sure which ribbon menu you are refferring. In my example, when I have a RadRibbonBarChunk initially collapsed, it is not visible, and there is there is no default menu where I can still see the chunk. Please provide me with this additional information about your case. It will allow me to help you further.

    Sincerely yours,
    Nikolay
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  6. David DeLella
    David DeLella avatar
    3 posts
    Member since:
    Jul 2008

    Posted 25 Jul 2008 Link to this post

    To duplicate I just added a ribbon bar to a new forum.  Create two tabs each with a single chunk and some icons.  In the form load I collapsed the first chunk.  When the application loads I see only one tab but the chunk and ribbon showing is for the hidden tab and not the tab that is visible.  Apparenly the collapsed tab is still marked as IsSelected = True.  To fix the problem I simply control the IsSelected to the single table which is always showing.

    Is there a why to hide all tabs nicely?  I know I can collpase all of them but then the bottom ribbon area shinks up to a single bar.  If perhaps I did not have a complicated menu and just wanted a single ribbon with icons and no tabs or not ribbon at all and just the orb menu and QuickLaunchToolbar.  These are more suggestions.
  7. Nikolay
    Admin
    Nikolay avatar
    1803 posts

    Posted 30 Jul 2008 Link to this post

    Hi David DeLella,

    I followed your steps but did not get results exactly the same like yours. I made two tabs with one chunk in each of them. Then, in the Form_Load event handler I set the chunk in the first tab to be Visible Collapsed. When I ran the application I got two tabs visible (not one as in your case). The chunk set to Collapsed was not visible, while the other was.

    Should you want to hide the tabs themselves, just set TabItem.Visibility = ElementVisibility.Collapsed. I demonstrated this in the sample project attached.

    As the the bottom ribbon area, if you set the chunks to be Hidden instead of Collapsed and the area will not be shrunk.

    If you have additional questions, feel free to contact me.

    Best wishes,
    Nikolay
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Back to Top
UI for WinForms is Visual Studio 2017 Ready