Show menu on selection

5 posts, 0 answers
  1. Ahmet
    Ahmet avatar
    12 posts
    Member since:
    Jan 2012

    Posted 13 Apr 2012 Link to this post

    Hi,

    I am trying to build a window, where user can select different material types by selecting from a menu type interface. The top level is material class (Stainless Steel, Aluminum etc.) where one lower level is going to be the type (like, 304, 316... for Stainless Steel and 6061, 7075... for Aluminum). I would like to use breadcrumb control for this interface.

    My question is, when I first show the top level in the control, (Stainless Steel and Aluminum), when the user picks either one, can I make the next selection window shown without clicking the little arrow on the right side? I really would like this to be a click by click event, if possible.

    Can anyone help me on implementing a similar procedure?

    Thanks,

    Ahmet Unal
  2. Tina Stancheva
    Admin
    Tina Stancheva avatar
    3298 posts

    Posted 18 Apr 2012 Link to this post

    Hello Ahmet,

    If I understand your scenario correctly, you can handle the RadBreadcrumb.CurrentItemChanged event to open the dropdown menu with the children of the current item:
    private void RadBreadcrumb_CurrentItemChanged(object sender, Telerik.Windows.RadRoutedEventArgs e)
    {
        RadBreadcrumbBarItem item = (sender as Telerik.Windows.Controls.RadBreadcrumb).CurrentContainer;
        if (item != null && item.HasItems)
            item.IsPopupOpen = true;
    }

    Please give this a try and let me know if it works for you.

    Greetings,
    Tina Stancheva
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

  3. UI for WPF is Visual Studio 2017 Ready
  4. Ahmet
    Ahmet avatar
    12 posts
    Member since:
    Jan 2012

    Posted 20 Apr 2012 Link to this post

    Works great... Just what I needed...

    Thanks Tina.
  5. ben
    ben avatar
    5 posts
    Member since:
    Jul 2007

    Posted 14 Apr 2015 in reply to Tina Stancheva Link to this post

    The described solution works, except if you navigate back multiple levels, i.e. if you implement:

    private void RadBreadcrumb_CurrentItemChanged(object sender, Telerik.Windows.RadRoutedEventArgs e)
    {
        RadBreadcrumbBarItem item = (sender as Telerik.Windows.Controls.RadBreadcrumb).CurrentContainer;
        if (item != null && item.HasItems)
            item.IsPopupOpen = true;
    }

    With a two level breadcrumb menu, ie First Level -> Second Level, and click 'First Level' the drop down will be shown as expecrted.

     If you have a three level breadcrumb menu, First Level -> Second Level -> Third Level, one can click on 'Second Level' all day, select an item from the dropdown, and update the 'Third Level' display.

    However, in this scenario if you select 'First Level' the menu will appear, but the second you click on one of the menu items the application crashes with a:

    XamlParseException - {"'FocusVisual' name cannot be found in the name scope of 'System.Windows.Controls.Grid'."}

    Additional information: 'FocusVisual' name cannot be found in the name scope of 'System.Windows.Controls.Grid'.

    Any ideas on how to work around this?

  6. Milena
    Admin
    Milena avatar
    204 posts

    Posted 17 Apr 2015 Link to this post

    Hello Ben,

    I have already replied to your question in the support thread you opened, but I will share some part of the information here so that other from the community will be able to find it.
     
    So, we can confirm that the described behavior is not expected and we logged it in our Feedback portal as an issue, where its progress could be tracked.

    In the meantime, as a workaround I can suggest the following:
    1. You can edit the BarItemControlTemplate (using implicit styles) and change the positions of "CommonStatesWrapper" and "headerContainer" borders. For your convenience I implement this approach in the attached project -  see the last Breadcrumb.
    2. You can again edit the ControlTemplate (BarItemControlTemplate) and replace the SplitButton with DropDownButton - so you can open the DropDownConten when you click on the button part (not only the "dropdown selector") - see the third Breadcrumb in the project.

    In addition I would ask you to keep the communication for a particular topic in a single thread. This way we will be able to track the issue easier, organize our communication history better and assist you in a more convenient manner. We appreciate your understanding in this matter.

    Regards,
    Milena
    Telerik
     

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

     
Back to Top
UI for WPF is Visual Studio 2017 Ready