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

Show menu on selection

4 Answers 136 Views
BreadCrumb
This is a migrated thread and some comments may be shown as answers.
Ahmet
Top achievements
Rank 1
Ahmet asked on 13 Apr 2012, 07:55 PM
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

4 Answers, 1 is accepted

Sort by
0
Tina Stancheva
Telerik team
answered on 18 Apr 2012, 11:18 AM
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 >>

0
Ahmet
Top achievements
Rank 1
answered on 20 Apr 2012, 07:34 PM
Works great... Just what I needed...

Thanks Tina.
0
ben
Top achievements
Rank 1
answered on 14 Apr 2015, 05:34 PM

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?

0
Milena
Telerik team
answered on 17 Apr 2015, 08:39 AM
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.

 
Tags
BreadCrumb
Asked by
Ahmet
Top achievements
Rank 1
Answers by
Tina Stancheva
Telerik team
Ahmet
Top achievements
Rank 1
ben
Top achievements
Rank 1
Milena
Telerik team
Share this question
or