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

Able to select a PropertyDefinition after Item set to null

1 Answer 89 Views
PropertyGrid
This is a migrated thread and some comments may be shown as answers.
PaulR
Top achievements
Rank 1
PaulR asked on 05 Oct 2016, 01:39 AM

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(). )

 

 

1 Answer, 1 is accepted

Sort by
0
Martin
Telerik team
answered on 07 Oct 2016, 10:51 AM
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.
Tags
PropertyGrid
Asked by
PaulR
Top achievements
Rank 1
Answers by
Martin
Telerik team
Share this question
or