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, Is it possible to display properties of multiple objects of same type using WPF propertygrid? e.g. I have two objects Person.Alice and Person.Linda. I need to see the properties of both these objects at the same time. The propertygrid must show the properties with the same value as they are. Properties with different values must be shown blank. .net propertygrid allows you to do this using "SelectedObjects" which can be a collection of objects. Is there anyway to achieve this in WPF propertygrid? Thanks. |
|
|
We don't currently support this directly, but if it's critical for your application then we can look into it. Let me know. In the meantime, it should be possible to achieve the same effect by creating a shim object which exposes the same properties as the real objects, with getters that pull in the values from the real objects and return either the value (if all objects return the same) or nothing (if different objects return different results), and setters that call the setters on all the objects. Then set SelectedObject to the shim object. In fact, that's probably how we'd implement a SelectedObjects property internally. |
|
|
Hi Ivan, We have the same request. Did you implement this functionnality? regards, Cedric. |
|
|
Hi Cedric, No, this is still on the "to do" list. Let us know how important/urgent it is to you, and we will see if we can plan it in. |
|
|
Hi Hivan, This is quite bit urgent/important for us, and we do not have necessary resource to do that in a short time. I think this it could also be an interesting functionality for your product. |
|
|
Hi Cedric, I have now started looking at this and will let you know how it progresses. |
|
|
Thank you, I will wat for yours news |
|
|
Hi Cedric, We now have an early implementation of multi-select
functionality in the nightly builds. This should not be considered
production-ready at this stage but we would encourage you to take it for a spin
and give us your feedback. You can get the latest nightly from the store. The way it works is a little different to the Windows Forms grid multi-select. Instead of setting a separate SelectedObjects property on the grid, you create a MultipleObjectWrapper and set grid.SelectedObject to that. For example: MultipleObjectWrapper
aliens = new MultipleObjectWrapper(anastasia, bill); I know localisation is important to you so we have provided the following localisation/translation hooks. These refer to the UI which is displayed when the values are inconsistent across the selected objects (and will probably make more sense once you see that UI). * ManyEditor.ResetButtonContentKey: the content of the "set to a consistent value" button. By default, this is a diamond glyph. * ManyEditor.ResetToolTipContentKey: the content of the tooltip for this button. By default, this is English-language text explaining that the values are inconsistent and that the button sets a default value. * ManyEditor.InconsistentValuesTemplateKey: a DataTemplate for what is displayed in place of the value. By default, this is a greyed-out text block with the text "Multiple (Type)" where Type is the type of property. You can override these by creating your own resources with these keys, as I believe you already do for the calendar "Today" button. We would be keen to hear your feedback and of course please let us know of any bugs you run into. Again, I have to stress that this is an early build and is likely to be a bit rough! |
|
|
Hi Ivan, Thank you for this release. I have quickly test it and it works fine. One thing to add, I think, is to remove the diamond glyphe for read only properties. The displayName attribute is working fine. I did not test localisation yet, but I will do during next week I hope ( we are a little bit in hurry here). |
|
|
> remove the diamond glyphe for read only properties Thanks for reporting this. It is now fixed and will be in the next nightly. |
|