Selection Bug

4 posts, 0 answers
  1. Matthias
    Matthias avatar
    6 posts
    Member since:
    Feb 2009

    Posted 25 Mar 2010 Link to this post

    Hello,

    we have a problem using the tree view, when the control is databound to a list with duplicate objects (the object occurs in tree node X and tree node Y). The problem is, that the selection automatically switches to the first occurrence of the object whatever item of the object you click.

    I attached the code of a demo-project, which shows this behaviour. With the standard WPF-tree everything is working.

    For your information: we are not using the latest version of Rad Controls. An update to the newest version is not possible for us due to compatibility issues.

    Thanks in advance for the support.
    Matthias
  2. Valentin.Stoychev
    Admin
    Valentin.Stoychev avatar
    2198 posts

    Posted 31 Mar 2010 Link to this post

    Hi Matthias,

    We are aware of this behavior and it is expected.

    You are correct about the Microsoft treeview. But things are different here - our treeview is much more complex control and is entirely data driven. It is possible to support and this scenario, but it will involve a lot of code to be written in order to support this specific scenario.
     
    The main difference between the WPF treeview and Telerik treeview is that ours can handle millions of records because of the use of virtualization - which means that we do not rely on the containers to keep the state of the items, because the containers are recycled all the time and can not keep any state. You will get the same effect when using the WPF listbox control which is also virtualized.

    For the moment we can only suggest you not to use the same instance of your business object twice in the bound collection, we do not have plans to support this scenario.

    Regards,
    Valentin.Stoychev
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
  3. UI for WPF is Visual Studio 2017 Ready
  4. Mathew Murphy
    Mathew Murphy avatar
    1 posts
    Member since:
    Jul 2009

    Posted 28 Jun 2010 Link to this post

    This would be a feature I would like to see in the control. A pretty common use case for a tree is to group things by category and to assume that each object would only appear in one category is fairly limiting. I need to refactor from a scenario where an item only occurs once in the tree to one where it can appear multiple times under different nodes...
    I don't see how it can be much effort to implement internally in the control - you can get the RadTreeViewItem the user clicks on easy enough - it is already visible thus virtualisation is not an issue in that case. If you needed to select an item via code then a unique path on the objects should be all you need. If it isn't supported directly via the control the only options I can come up with are -
    1) Hack around the issue by getting the item the user clicked on PreviewMouseDown (MouseLeftButtonDown must get handled by the treeview) and then force a reselection at the RadTreeViewItem level.
    2) Create wrapper objects to bind to which would require much more refactoring.

    Please consider implementing this feature it would make life easier.


    *update: looking at the Q1 2010 version of the treeview the PreviewSelectionChanged is a great addition and could possibly help me here. Is there any way to 'Select Item by path'. There is an ExpandItemByPath, a SelectItemByPath would be useful also. I can use the IsSelected property on the node but managing this at the node level is messy. Thanks.
  5. Valentin.Stoychev
    Admin
    Valentin.Stoychev avatar
    2198 posts

    Posted 01 Jul 2010 Link to this post

    Hi Mathew Murphy,

    Thank you for this suggestion. We will implement SelectItemByPath right after the official Q2 release.

    Sincerely yours,
    Valentin.Stoychev
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Back to Top