Question

Setting SelectedItem on Breadcrumb control

Posted 10 years ago by Avatar Scott Currie
My application visualizes a complex tree structure. In order to simplify the visualization for viewing details, I am using a breadcrumb control as a filter for the tree viewer. That is, the application will only show the subtree rooted at the SelectedItem of the Breadcrumb. This is working fine in the direction where I binding the treeview itemssource to the Breadcrumb SelectedItem.

However, when I use code behind on an event handler in the tree view to set the SelectedItem of the Breadcrumb, the breadcrumb control accepts the SelectedItem, but does not show a trail along the top.

How can I force the breadcrumb to both accept a selected item and visualize the trail for that item?

Thanks,
-Scott

Comments (3)

Posted 10 years ago by Actipro Software Support - Cleveland, OH, USA
Hi Scott,

You need to handle the Breadcrumb.ConvertItem event and provide the proper trail from the "new" SelectedItem up to the RootItem. While the DataTemplates and Styles can be used to drill down the hierarchy, they cannot be used to work back up to the RootItem. Therefore, you have to perform this step by handling the ConvertItem event. In addition, this event can be used to convert to and from a string path.

Our Sample Browser shows how this is done in the "Breadcrumb File System" QuickStart under the Naviation section. In addition, there is a topic on this subject in our help file under "Actipro Navigation\Breadcrumb Features\Item Conversion".

Actipro Software Support
Posted 5 years ago by Ulf Johansen

Wouldn't it be a nice feature to add a ParentSource property on the container, so you don't have to handle the ConvertItem event, which is awkward when using MVVM?

[Edit: property should probably be called ParentSource (similar to ItemsSource) since it would be the data object that you would bind.]

[Modified 5 years ago]

Posted 5 years ago by Actipro Software Support - Cleveland, OH, USA

Hi Ulf,

Thanks for the suggestion.  We will write it down.


Actipro Software Support
Information The latest build of this product (2018.1 build 0674) was released 5 days ago, which was after the last post in this thread.

Add a Comment

Please log in to a validated account to post comments.