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

HistoryItems context

3 Answers 97 Views
BreadCrumb
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Yoann
Top achievements
Rank 1
Yoann asked on 03 Jan 2012, 02:05 PM

Hello,

 I need to change the visibility of an history item (or remove it from history items) of the breadcrumb, depending on user's actions.
 User can display detailed information of an object of the application (for example a customer).
 In that case, the breadcrumb will contain a reference to this detailed information panel in its history items.
 If user deletes this application's object, I want to remove the reference to its detailed panel from the crumbbread bar history items.

 Up to now, I did not find a proper way to match history item with the corresponding deleted object, and there's no data context on the RadBreadcrumbBarItem of the history.
 I can not use the path of the history item because it's not a unique identifier (it contains only a label entered by the user).

 
 Could you please let me know if there's a way to do that match ?

Thanks

3 Answers, 1 is accepted

Sort by
0
Zarko
Telerik team
answered on 06 Jan 2012, 12:12 PM
Hi,
As you've probably noticed you can modify the items in the History of the RadBreadcrumb by the HistoryItems collection. Unfortunately the history item doesn't have a reference to the item it represents, but it holds the path to it, so at the moment the DropDownHeader(the visible string) of an history item has to be this path otherwise it won't work.
You can workaround this by creating a custom RadBreadcrumbBarItem with changed Template so that the path is still kept in the DropDownHeader but the visible string is bound to some other property (e.g. Name).
I've created a sample project that demonstrates this so could you please examine it and tell us if this is what you're looking for?

All the best,
Zarko
the Telerik team

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

0
Yoann
Top achievements
Rank 1
answered on 06 Jan 2012, 01:38 PM
Hi,

 Thanks a lot for your quick answer and this demonstration project. 

 The way I'm using the BreadCrumb seems not to be compatible with default way it works, because as I'm displaying a name entered by a user, I'm not sure that there's will not have 2 paths identical, which will be a problem when selecting an item in the history.
 So unfortunately your workaround will not solve my issue. 

 I'll check if I can create a custom BreadCrumb to override the way historyItems are handled.

Thanks
 
0
Zarko
Telerik team
answered on 11 Jan 2012, 10:40 AM
Hi,
If your user enters two items with identical Names in the History:
itemOne.Name = "SomeName";
...
itemTwo.Name = "SomeName";
...
this.breadcrumb.HistoryItems.Add(itemOne);
this.breadcrumb.HistoryItems.Add(itemTwo);
(this throws an exception)
there will be problems indeed, but if they are with identical Paths and different Names there shouldn't be any issues:
itemOne.DropDownHeader = @"Some\Path";
itemTwo.Name = "nameONE";
...
itemTwo.DropDownHeader = @"Some\Path";
itemTwo.Name = "nameTWO";
...
this.breadcrumb.HistoryItems.Add(itemOne);
this.breadcrumb.HistoryItems.Add(itemTwo);
(this works correctly)
If you need any further help please feel free to ask.

All the best,
Zarko
the Telerik team

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

Tags
BreadCrumb
Asked by
Yoann
Top achievements
Rank 1
Answers by
Zarko
Telerik team
Yoann
Top achievements
Rank 1
Share this question
or