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
|
L.s., I see that the PropertyGrid has support for ICustomTypeDescriptor, but unfortunatly not for TypeDescriptionProvider. I have a lot of objects using TypeDescriptionProvider attribute in order to sort the properties to my will by overridingpublic override PropertyDescriptorCollection GetProperties(ITypeDescriptorContext context, object value, Attribute[] attributes)Is it possible to add support for TypeDescriptionProvider? Or can I do it myself somehow? Best regards, Jan van de Pol |
|
|
Hello Jan, Hmm, I thought this would have been handled automatically by the TypeDescriptor class. We will look into adding this for you (I don't think we currently provide the extensibility hooks for you to do so yourself). Thanks for the suggestion! |
|
|
Hello Jan, Would it be possible for you to provide an example of one of your classes and its TypeDescriptionProvider please? I am trying to create a test case and I haven't been able to match up the MSDN documentation with the override signature you describe. So in order to make sure we are addressing your real use case it would be great if you could provide us with an example. You can attach a zip file via the Options tab, or if it is sensitive email it via the contact form. Thanks for your help! |
|
|
Hi Ivan, Thanks for your support. I'll attach an example usage with this post. However, creating the example I noticed that I mentioned the wrong attribute. It's TypeConverter instead of TypeDescriptionProvider (sorry). However, the issue still remains as you can see in the sample, where I have put the Mindscape PropertyGrid next to the old Windows Forms propertygrid, so you can immediatly see the desired effect (the ability of custom sorting). Thanks in advance for your support. Jan |
|
|
Hi Jan, I have committed a candidate fix for this and it will be included in nightly builds dated 4 Mar 2009 and above, available from about 1430 GMT. Please give it a try and let me know if you run into any problems. Note this will not currently work with multiple selection because in a heterogeneous selection we don't know which type converter to use. In this case the grid will fall back to the default ordering. If this is an issue for you then let us know. |
|
|
Thanks Ivan! This does the job. About MultiSelect: I don't need multiple selection at the moment, but I could think of 2 rules in order to determine ordering:
I tweaked a little with my test app and see that ms propertygrid looses the fourt property on different types ... That's definitly not what one wants. However when all instances are of the same type, the expected TypeConverter is being used as it seems (first rule above). For the moment, I'm quite happy with the current implementation. Thanks again.
|
|