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
|
I have an object "A" with property "PropertyA" and it's PropertyType = "B".
I created custom property descriptor for "PropertyA" wich returns an object of type "Wrapper", but leaves "PropertyA" property type without changes (PropertyType = "B").
I have custom type descriptor for Wrapper class, wich allows to work with wrapper like with object of type "B".
When I try to use TypeEditor of type B on single object everything is ok.
But when i try to use it on multiple objects I get an exception at Mindscape.WpfPropertyGrid.Many`1.GetValue(T& value, Boolean& isConsistent) with message like "Unable to cast object of type Wrapper to type B".
|
|
|
Wrapper means Wrapper<B>.
|
|
|
I'm not sure from your question whether Wrapper<B> is the PropertyDescriptor, or the type of value returned by the PropertyDescriptor's GetValue method -- I think it's the latter but that leaves me a bit unsure as to how your Wrapper<B> type descriptor is then treating this as a B. Could you create a small project that reproduces the problem for us, so that we can ensure we are addressing the correct scenario? You can attach a zip file via the Options tab, or if you don't want to have it publicly visible then mail it to ivan @ the obvious domain name (please remove all binaries first). Thanks! |
|