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 there, If the value of NumericTextBox is binding to the double value and the initial value is double.NaN, it automatically changed to 0 on display, which it is very perceptive. The more serious problem is that If we really want to enter a value 0, it will not update the property bound undernearth, since the control did not think it is changed. Can we have a property to set so it will display NaN or just allow the NaN or give the empty value? you can reproduce this by changing the NumericTextBoxDemo.xaml/.cs by:
|
|
|
Hello Gordon I'm sorry to say that the NumericTextBox only supports decimal values. Normally this is fine for double values, but in the case of Double.NaN, there is no way to even set the Value property. The WPF framework intercepts it first and changes it to the default value which is 0. I've put this item on the backlog which may result in building a new control to support this. I hope there is some other work around you can use in the mean time. Jason Fauchelle |
|
|
Hello Gordon. I'll be exploring this issue again tomorrow. Jason Fauchelle |
|
|
Hello Gordon Looks like setting a converter will not be an option. I tried to implement some internal trickery to make the NumericTextBox think it can handle Double.NaN, but it got too messy. Instead I'll implement a DoubleTextBox for you tomorrow. Jason Fauchelle |
|
|
Hello Gordon The DoubleTextBox control is finished and will be available in the next nightly build. This includes Double.NaN support. At the moment, NaN can only be set programatically or through a binding. The user can not yet type "NaN" to set the value. Also, when NaN is displayed, they need to highlight the whole word to replace it with a number rather than backspacing it letter by letter. See the behavior for yourself when you install the next nightly build, and let me know if any of these details need to be implemented. Jason Fauchelle |
|
|
Hi Jason, I downloaded Dec. 7's nightly build, it seemed not working either it is alone or put into DataGrid. 1) Run the application, look the Age data column, you cannot change the value. 2) On the bottom of window, I put the DoubleTextBox, it even does not show. 3) Do we need to put the license of DoubleTextBox in *.lic file? I don't know what to put there. Please let me know what I did wrong. Thanks Gordon |
|
|
Hello Gordon My apologies, there was a bug in the DoubleTextBox control which will be resolved in the next nightly build. This control does not have licensing, so don't worry about that. Jason Fauchelle |
|
|
Thanks Jason, it is working now Gordon |
|