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
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 >>
Thanks Tina.
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?
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.
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.