Reselecting event?

2 posts, 0 answers
  1. Micheal
    Micheal avatar
    5 posts
    Member since:
    Sep 2012

    Posted 22 Nov 2010 Link to this post

    I am using a RadPanelBar to allow my users to select a report category, then a report in the category. Once the user clicks the report the selected event is fired and I hide the RadPanelBar and go show them the report. If they come back to the report selection, I have left the RadPanelBar exactly as they left it, with the last report they selected highlighted. Everything thing up till this point is great. However, if they want to go back to the report they just saw, and select the already selected RadPanelBar item, no Selected event is fired. I've tried other RadPanelBar events such as MouseDown, etc., nothing works. Does anyone know how to detect the reselection of an already selected item?

    I'm using a HierarchicalDataTemplate to display the RadPanelBarItems and it is bound to an ObservableCollection. I can have a MouseDown event on one of the TextBoxes in the template, but then it fires before the RadPanelBar Selected event. Therefore, it's very hard to know from the template MouseDown event what is going on. Is the user reselecting an item, choosing another, etc? It seems that to make an intelligent template MouseDown event handler work correctly, you are abandoning the RadPanelBar Selected property and doing it all on your own. Is there something I'm missing here?
  2. Petar Mladenov
    Petar Mladenov avatar
    2991 posts

    Posted 25 Nov 2010 Link to this post

    Hello Micheal,

    Since the last Release of the RadControls, the RadPanelBar inherits the RadTreeView and the Selected event  is not fired when an already selected item is clicked. The reason why we made the change was that there were many problems with the previous version of RadPanelBar - keyboard navigation, focus, expansion etc. By inheriting from RadTreeView we managed to solve all of them. We also added a feature request named Add a Click event for the RadPanelBarItem and you can vote for it here ==>

    You can use the MouseLeftButtonUp event of the RadPanelBar which does not handle the Selected event. If you have a textbox defined in the template of the RadPanelBar,  you can add MouseLeftButtonDown or MouseLeftButtonUp events. This could be done in the Loaded event handler of the TextBox with the UIElement.AddHandler method which allows the handled events to be fired with setting the parameter handledEventsToo  to true.
    Please examine the attached solution and let me know if it satisfies your needs completely. If it doesn`t  or your scenario is more complex, you can send us your code or an isolated sample. We would be glad to assist you further.

    Best wishes,
    Petar Mladenov
    the Telerik team
    Browse the videos here>> to help you get started with RadControls for WPF
Back to Top