Hi,
Is it possible to keep tracking last selected property ? i.e user expanded couple of levels down to some property Xafter changing selected object I would like to automatically expand the properties down to the same property X if it is the same object type with the same properties so the user dos not have to do it manually over and over again when he want to compare property X between instances ?
Best regardsKrzysztof
Hello Krzysztof,
I have debugged your method a couple times, You find the first item in the list and try and hand out that. The reason seems to be use of the method FirstOrDefault. You will want find the correct item and then try and expand that.
Hi Michael,
Please double check the sample and debug it instead of quick look at the code.1. properties are generated by custom generator and setter of IsExpandable is internal, even hacking and setting it by reflection, when expanding it in the code nullreferenceexception is thrown - it works for first level, for second expandable item ('expandable further') the PropertyGrid property of the item is null
2. no, functions looks for correct items, please double check and debug
Thank you for the update. The error is occurring because you are trying to expand an item that isn’t expandable, you will want to check IsExpandable before expanding and item:
if (itemToSelect.IsExpandable)
Also your function seems to just grab the first item in the property grid instead of looking for the next item to expand.
yes, please expand the first property 3 levels down, select the last expanded (1.)and click 'change object' button (2.)
Thank you for the update and sample. I use the v20.1.20201.9 dlls in your sample and I don’t experience a crash. Do you have steps you use to reproduce the issue?
Sincerely,Mike P.Software Developer