How to set the value of the DoublePropertyEditor to 0?

Grids for WPF Forum

Posted 10 years ago by lik
Version: 13.2.0591
Avatar

The type of the element is double,and I use DoublePropertyEditor to control.Now I set the value of the element to 123,then I press the Backspace.The value of the element will be setted back to 123.How do I set the value of the element to zero this time?

Comments (5)

Answer - Posted 10 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hello, I believe that on the DoubleEditBox, you can set IsInitialValueAutoUpdated to false and then set InitialValue to zero.  The DoublePropertyEditor doesn't have those properties available on it to pass down to DoubleEditBox, so you might have to redefine the template for BuiltinEditors.DoubleValueTemplateKey. 

Your company has WPF Studio so you can download the default styles/templates and find the one for {x:Static propgrideditors:BuiltinEditors.DoubleValueTemplateKey}.  Then clone it to your app's Resource and add in those property values on the DoubleEditBox in the template.


Actipro Software Support

Posted 10 years ago by lik
Avatar

Now I use the DoubleEditBox,and I set IsInitialValueAutoUpdated to false and then set InitialValue to zero.But I can't realize it.

Posted 10 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hello, I'm sorry but I misunderstood how the InitialValue property worked.  It looks like it controls the initial value that gets set if you uncheck and then re-check the optional checkbox in the DoubleEditBox.  It doesn't have any effect over what happens when the end user clears the text and then tabs out of the control, since that will reset to the last "valid" value.  It doesn't appear that we have anything for controlling that at this time as the value reset is coming back from the underlaying PropertyDescriptor.


Actipro Software Support

Posted 10 years ago by lik
Avatar

 Do you have a way to achieve it ?

Posted 10 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Sorry but I don't believe we have a way to achieve that at this time.


Actipro Software Support

The latest build of this product (v24.1.1) was released 2 months ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.