This thread looks to be a little on the old side and therefore may no longer be relevant. Please see if there is a newer thread on the subject and ensure you're using the most recent build of any software if your question regards a particular product.
This thread has been locked and is no longer accepting new posts, if you have a question regarding this topic please email us at support@mindscape.co.nz
|
Summary: Using the "Add" command in the collections editor when showing multiple selected objects does not refresh the children.of the row. Repro: Change the Sample Project Person.cs as shown below. Open the QuickStart project in "Multiple Selected Items" mode. Press "Reset" on the MULTIPLE grid. Press "Add on the MUTLIPLE grid. Note that the individual item grids are being updated with children, but the multiple grid has no expander and hence cannot show the children.
public partial class Person : Observable |
|
|
Thanks for reporting this. A fix is in progress but won't be ready for tonight's nightly (sorry, we've had conference commitments this week, and have had a bit of catching up to do). I'll post again when we have something for you. |
|
|
There will be a candidate fix for this in the 19 Sept nightly build. Please let us know if you see any issues. In particular, it is possible you will see memory issues if your app deals with a very large number of objects with settable collection properties -- let us know if this happens. |
|
|
[quote user="ivan"]There will be a candidate fix for this in the 19 Sept nightly build.[/quote] Hi Ivan, Can you confirm this fix made it into the nightly build. We have updated to the latest nightly build, downloaded this morning, and the issue is still reproducible. - Dennis |
|
|
Hi Dennis, Yes, this fix was committed so, barring something amiss in our nightly build upload script, you should have it. Could you make sure you have forced a full clean and rebuild? Can you check the build number (assembly version) of the referenced WPF Property Grid DLL? Thanks! |
|
|
Mea culpa, the fix is in the build.
However we have just noted an edge case that the fix does not work for.
Take this sample data, my changes are highlighted. #1 public partial class Person : Observable
Open the QuickStart project in "Multiple Selected Items" mode. Press "Reset" on the MULTIPLE grid. Note that the read-only collection is not updated. #2 Another case that we have in our master test object is where the same collection is displayed twice. For Example: public partial class Person : Observable
Thanks for you help. Really appreciate it.
- Dennis
|
|
|
Hi Dennis, Thanks for letting us know about those cases; I'll look into them. Regarding the changes, there are changes in the Many.cs and Node.cs files: Many.cs: added CollectionMany<T> class plus logic for instantiating it in Many.GetMany, and changed Reset to call SetValue instead of Value=... Node.cs: changed implementation of Children property and added OnValueCollectionChanged and OnSourcePropertyChanged methods. These went out in the 19 Sept nightly so it is possible somebody else has already downloaded and integrated those changes. Let me know if you need more info. |
|
|
Thanks Ivan. The displaying a read-only collection of an observable collection is a common case that we need to support. BTW: I just realised my error when I was integrating the nightly builds. The source code is supplied in a .zip file and not loosely in the WPF Property Grid 2.0\Source\ folder.I wrongly assumed that the zip file was provided as a local backup and that I did not needed to unzip the files for each release. I was integrating the last version that I had extracted on the initial add. :\
|
|
|
Dennis, sorry for the delay in getting back to you about these additional cases. I think in this case the issue may be in the class definitions. In your first example, when you press the Reset button, _hobbies is set to a new ObservableCollection<string>. However, _hobbiesReadOnly continues to wrap the old ObservableCollection<string>. Your Hobbies setter needs to also set _hobbiesReadOnly to a new ReadOnlyObservableCollection<string>(_hobbies). In your second example, I think this issue is that the A_Hobbies setter is telling us that the A_Hobbies property has changed, but not that the B_Hobbies property has also changed. We therefore continue listening for events from the old B_Hobbies collection. You A_Hobbies setter therefore also needs to call OnPropertyChanged("B_Hobbies") (and ditto mutatis mutandis for the B_Hobbies setter). This will also apply to your first scenario when the issue above is fixed: the Hobbies setter will need to raise PropertyChanged for HobbiesReadOnly. I have not tested to make sure that we work correctly with these fixes -- I think we should, but let us know if you still see problems after resetting the ReadOnlyObservableCollection and raising the PropertyChanged events for the cascading property changes. Once again, apologies for the delay in getting round to this. |
|
|
NPS regarding the delay Ivan. I haven't had a chance to revisit the issue yet. I will look at it in the next week or so and will get back to you with confirmation of the fix. |
|