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, I'm trying to make the property grid edit a TimeSpan property. I saw some other threads in here but none of them really help. I can't really declare a PropertyEditor and added it to the list of editors because of the dynamic nature our framework... So this was my frist try: FrameworkElementFactory timeSpanEditor = new FrameworkElementFactory(typeof(Mindscape.WpfElements.TimeSpanPicker)); This doesn't work. The TimeSpanPicker doesn't get the value from the edited object and doesn't transfer selected values down. Since I read somewhere along the forum that the TypeEditor doesn't support struct types and instead the property editor should be used, and since i can't use a property editor because I don't have the type and the property name that i'm going to be editing, I tried this next: private class TimeSpanEditor : Mindscape.WpfElements.WpfPropertyGrid.ObjectWrappingEditor with the same result...
Pablo
|
|
|
First off, TypeEditor used to not support structs, but it does now. So you should be fine to use a TypeEditor instead of a smart editor. And your dynamic template/editor looks like it should work fine. Unfortunately, there is a bug in TimeSpanPicker which results in its losing its binding in this scenario, hence the problems you see. I have committed a fix for this and it will be included in the next nightly build, available from about 1200 GMT. After updating to the nightly, your dynamic code should work fine. If not please let us know! |
|
|
I still don't have access to a renewed license... so again I can't really test your bug fix... I'm left once again to find a workaround now that you confirmed there's a bug there :( I can see in the source code that the problem is when setting the text property.So i'll see what I can do to jump around that. (subclass and override property change callbacks on the property metadata?) Thanks again, Pablo
|
|