Able to select a PropertyDefinition after Item set to null

2 posts, 0 answers
  1. PaulR
    PaulR avatar
    19 posts
    Member since:
    Jun 2016

    Posted 04 Oct Link to this post

    To test:

    Create a class with properties and set the RadPropertyGrid.Item to an instance of that class.

    Select one of the properties in the grid.

    Set the Item to null. (Clear selection if your Item is binded to some listbox selection, for example).

    The property grid should be empty now. Click in the empty space.

    Notice that you can see the previous selected property name in the Description Pane.

    More importantly to us for CanExecute calls, RadPropertyGrid.SelectedPropertyDefinition is not null. (even though Item==null).

    This is a reference leak also since you are holding onto references after Item is set to null. :(

     

    (Looking at the code, it looks like when Item property changes, you are setting SelectedPropertyDefinition to null, but you aren't clearing the SelectedPropertyDefinitions collection. As a result, the RadPropertyGrid.OnMouseLeftButtonDown calls SetSelectedPropertyDefinition(), and in there, it simply checks for any items in SelectedPropertyDefinitions and calls LastOrDefault(). )

     

     

  2. Martin Vatev
    Admin
    Martin Vatev avatar
    90 posts

    Posted 07 Oct Link to this post

    Hello Paul,

    Considering your report, indeed this is an issue in RadPropertyGrid. I have logged it in our feedback portal. You can track its progress, subscribe to status changes and add your vote/comment to it on the following link - feedback item. I have also updated your Telerik points as a gratitude for your cooperation.

    Regards,
    Martin Vatev
    Telerik by Progress
    Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
  3. UI for WPF is Visual Studio 2017 Ready
Back to Top