Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
315
Custom ValueEditor always converts value to string
posted

I'm trying to create custom ValueEditor and it seems like the Value property of editor always contains my value as a string. This ValueEditor is supposed to accept some enum and basing on its value change cell's color (simply display a rectangle with appropriate background).

I'm setting ValueType of my editor in several ways, e.g.:

in static constructor:

ValueTypeProperty.OverrideMetadata(

 

typeof(StatusEditor), new FrameworkPropertyMetadata(typeof(ExecutionResultStatus)));

in editor style:

 

 

 

 

<Setter Property="ValueType" Value="{x:Type DataModel:ExecutionResultStatus

}" />

but it seems that my editor always transforms my enumeration into a string.

I'm using my editor in UnboundField with Binding property set. Any ideas? Maybe you have a complete example of custom ValueEditor? (except one which I've already found called HostAnyControl, I want to have completely custom editor for my purpose, not some general editor which can host any WPF control).