Breadcrumb: manually editing the path results in unsolicited navigation

Navigation for WPF Forum

Posted 11 years ago by Andras Eles
Version: 12.2.0572
Avatar

I am having trouble setting up an editable Breadcrumb control. I have followed the patterns demonstrated in Navigation Samples Quick Start projects. I can browse my hierarchy via the Breadcrumb control, I can edit the path to an element, the recent items are recorded in the combobox. Everything seems ok except when I manually modify the path and press the Backspace key a couple of times, the ConvertItem event gets triggered before I hit Enter.

The point when it happens is when I reach the first common ancestor to the previous item in the combo box. As a result the previously selected item gets selected in the Breadcrumb. I.e.

Hierarchy:

Area
  51
    Test
  Recreational
    Swimming Pool
    National Park

First I type in Area.Recreational.National Park. When I enter the manual edit mode and press Backspace for the first time, the control leaves edit mode and the item gets reselected. Then I go to edit again, this time I could Backspace the whole path. Instead I Backspace till "Area." and modify the entry to Area.51.Test.

If I Backspace again to "Area." the previous item (Area.Recreational.National Park) gets selected automatically.

Any idea what may trigger the ConvertItem event when I reach a certain point in the current path?

Comments (4)

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

Hi Andras,

We tried to repro this but couldn't get it to happen.  If you'd like us to look into it, can you e-mail our support address a new simple sample project that shows it so we can debug it?  Reference this post and rename the .zip file extension so it doesn't get spam blocked.  Thanks!


Actipro Software Support

Posted 11 years ago by Andras Eles
Avatar

I have just sent a simple sample application that demonstrates the issue. 

cheers

Answer - Posted 11 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hi Andras,

Thank you for the sample. The issue is that your History needs to contain a list of items, not a list of paths (i.e. strings). You should be storing the RootNode and Group objects in your history, instead of their path representation. To do this you would:

  1. Change your history field to be a list of objects, not strings.
  2. Change your AddToHistory method to accept an object.
  3. Pass e.NewValue when you call AddToHistory.

The only other piece you would need is a DataTemplate to display your RootNode and Group objects while in the ComboBox drop down. This is set using the ComboBoxItemTemplate property on the Breadcrumb control.


Actipro Software Support

Posted 11 years ago by Andras Eles
Avatar

Thanks for the help. It works now as expected. 

The latest build of this product (v24.1.1) was released 21 days ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.