I'm using the UltraMaskedEdit control. I need it to behave as the UltraGrid does when it is bound to an object with a property of type nullable double. In this scenario the user can enter whatever number they would like with however many decimal places provided its convertable to a double data type.
I cant find the correct settings to make the UtraMaskEdit behave the same way. I'm aware of the EditAs property and have tried various different combinations. I can't use a input mask because if I do then naturally they are still restricted to that. I just need a way to allow the user to enter whatever they would like provided it can be converted to a nullable double. The EditAs = Double for some reason automatically assumes that I have 2 decimal places. That seems incorrect to assume.
Hi Derek,
By default, the grid doesn't use a masked editor for doubles. It uses a plain old text editor. The Mask Editor will always limit the user to a particular number of digits. There is no way to enter unlimited digits into it.
So you probably want to just use UltraTextEditor and validate the user's entry in the Validating event of the control.
Thanks Mike,
I'm not sure how I could do that because I'm dealing with a double? and using databinding for all of our controls. The text editor only has a text property and no value property. I'm not sure how the databinding will react to being bound to a different data type and having to convert the string into a double? but I will give it a try.
Thanks again.
Fantastic! Thanks.
Hi,
Actually, the UltraTextEditor does have a Value property you can bind to. I just tried it out binding it to a Double field and it works fine. I can even edit the value in the UltraTextEditor and it converts the string to a double with no problem. The only case you have to watch out for is if the user types letters or something else that can't be converted into a double.