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
|
Hi, Suppose I have 2 classes A and B, which are defined as follows (left out INotifyPropertyChanged ans so on for clarity): class A When I have severel instances of class A that each has a different instance of class B, but all have the same value for Length, I would like to be able to update the length in all those instances of class B. I realize that this is not the default behaviour, but is it possible to realize? What steps would I have to take? Best regads, Jan |
|
|
This is not possible using the multiple object behaviour that's built into the property grid. The issue is identifying the various Bs as "different but reconcilable." The only way I can think of to accomplish it would be to write your own equivalent of MultipleObjectWrapper, and set grid.SelectedObject to your MOW instead of setting the grid.SelectedObjects collection. (Internally, this is how setting grid.SelectedObjects works, but it's hardwired to use our MultipleObjectWrapper class.) Please be warned that this will probably not be trivial to do (it's reasonably easy to get 80% done, but there are a lot of details). However, if you have a source code licence, you could use our MultipleObjectWrapper and related classes as a basis and that should save you a fair bit of time. If you do decide to try this, one tip: aim to use the Many class to surface the merged properties on your MOW, rather than writing your own. Not only will it save you writing and debugging your own merged-value class, but the property grid has special handling for Many which means it may not be possible to make it work nicely with your own class. |
|