I have an io field where I want to accept a number from 0 - 99,999. So I use the Ultra Numeric Editor and set the Min Value to 0, the Max Value to 99999. What's irritating me is when the field is displayed on the screen it has a Zero in it (which is correct) and when I tab into the field, the cursor is set in front of the 0. Consequently, if I enter a 1, the number becomes 10... I don't want that, I want it to change the value from 0 to 1. What can I set to have the Value automatically selected when I enter the field so that whatever I type OVERWRITES the value that was in there?
Why does the UltraMaskedEdit select the value when you tab into the field but the UltraNumericEditor doesn't? I would use the UltraMaskedEdit control as my Numeric IO field if I could set it to right justify the value and enter the value from the right side like a Numeric editor would, but unfortunately, I can't seem to make it do that... More irritation...
My second complaint on the Numeric Editor is that if I delete the 0 then try to exit the field, I get a beep and the cursor won't leave the field until I put in a 0 or some other value. (I realize I DO have the Nullable property set to False, which is what I want) How can I set a Default (like 0) value for the field?
Finally, I STILL don't get emailed replies to my posts, even tho I ask it to.
Hi Steve,
Wolven said: I have an io field where I want to accept a number from 0 - 99,999. So I use the Ultra Numeric Editor and set the Min Value to 0, the Max Value to 99999. What's irritating me is when the field is displayed on the screen it has a Zero in it (which is correct) and when I tab into the field, the cursor is set in front of the 0. Consequently, if I enter a 1, the number becomes 10... I don't want that, I want it to change the value from 0 to 1. What can I set to have the Value automatically selected when I enter the field so that whatever I type OVERWRITES the value that was in there? Why does the UltraMaskedEdit select the value when you tab into the field but the UltraNumericEditor doesn't?
Why does the UltraMaskedEdit select the value when you tab into the field but the UltraNumericEditor doesn't?
I did a brief test using the inbox TextBox control, the UltraNumericEditor, and the UltraMaskedEdit control.
When you tab into the TextBox or the UltraMaskedEditor, it appears to select whatever text was last selected when you left the control. So initially, the first time you tab into one of these controls, it selects the entire text so you can overwrite it. But once you enter one of these controls and change the selection or move the cursor, then the next time you tab into that control, the cursor and selection return to their last known state.
For example, if you tab into a TextBox the first time, all of the text is selected. If you then type something into the TextBox and then move away and tab back into it, the text is not selected the second time. Instead, the cursor appears in the last place you left it.
The UltraNumericEditor seems to follow the same behavior, except that it does not select all of the text the first time you tab into it. So this does indeed appear to be a bug in the control. I'm going to forward this thread to Infragistics Developer Support so they can write this up and get it corrected.
Wolven said:I would use the UltraMaskedEdit control as my Numeric IO field if I could set it to right justify the value and enter the value from the right side like a Numeric editor would, but unfortunately, I can't seem to make it do that... More irritation...
Have you tried something like this?
this.ultraMaskedEdit1.Appearance.TextHAlign = Infragistics.Win.HAlign.Right;
Wolven said:My second complaint on the Numeric Editor is that if I delete the 0 then try to exit the field, I get a beep and the cursor won't leave the field until I put in a 0 or some other value. (I realize I DO have the Nullable property set to False, which is what I want) How can I set a Default (like 0) value for the field?
You could do something like this:
private void ultraNumericEditor1_ValidationError(object sender, Infragistics.Win.UltraWinEditors.ValidationErrorEventArgs e) { UltraNumericEditor numericEditor = (UltraNumericEditor)sender; string invalidText = e.InvalidText.Replace("_", "").Trim(); if (invalidText == null || invalidText.Length == 0) { e.RetainFocus = false; numericEditor.Value = 0; } }
Wolven said:Finally, I STILL don't get emailed replies to my posts, even tho I ask it to.
I have not heard any other customer complaints about this. I, myself, receive dozens of e-mail notifications from the forums every day. It seems unlikely that there is some problem with the forums themselves that is affecting only you. This is most likely due to a spam filter on your end - if not on your machine, then perhaps on the part of your ISP.
Hey Mike,
I found the same issue as you describe with the Ultra Masked Edit control. i.e. It selects all the data the first time you enter the field but if you type something and move away, when you re-enter the field it doesn't select the data. My question is, Why not? Every other Windows input field control I've used does (as far as I know). I think it SHOULD select all the data each time you enter the field whether the data has been changed or not.
I did notice that the Ultra Numeric and Masked Edit controls have a property called; SelectAllBehavior. I tried setting it to the two different settings but didn't really notice any difference. I did find that two Masked Edit controls that APPEAR to have all the properties set identically; mainly Edit As "String" and Input Mask "C" and SelectAllBehavior "SelectEnteredCharacters", behave differently. On one of them, it behaves just the the numeric fields we're discussing. The other one selects the data even after you change it, move away and then tab back in. I haven't been able to find what's making the difference.
Regarding the Default Value... If it's a Numeric Editor, and it's set to Not Nullable, and there isn't any data in the field, Wouldn't it make sense that the value SHOULD be set to 0 (zero) automatically???
And if it's a Masked Edit control with a Numeric Input Mask and it's set to Not Nullable, and there isn't any data in the field, Wouldn't it make sense that the value SHOULD be set to 0 (zero) automatically???
It certainly seems to me like it should. :)
As for my emails... I get the "noreply" emails from the support people when they email me regarding open cases. But I don't get emails when people reply to my posts for some odd reason.
Wolven said:I found the same issue as you describe with the Ultra Masked Edit control. i.e. It selects all the data the first time you enter the field but if you type something and move away, when you re-enter the field it doesn't select the data. My question is, Why not? Every other Windows input field control I've used does (as far as I know). I think it SHOULD select all the data each time you enter the field whether the data has been changed or not.
I'm not sure what you mean by "Every other Windows input field control", but as I said above, I tried this same test with the inbox TextBox control and it behaves the same way. It remembers the SelectionStart and SelectionLength that it had the last time it has focus and when you tab into it, it returns to the same state.
Wolven said:I did notice that the Ultra Numeric and Masked Edit controls have a property called; SelectAllBehavior. I tried setting it to the two different settings but didn't really notice any difference. I did find that two Masked Edit controls that APPEAR to have all the properties set identically; mainly Edit As "String" and Input Mask "C" and SelectAllBehavior "SelectEnteredCharacters", behave differently. On one of them, it behaves just the the numeric fields we're discussing. The other one selects the data even after you change it, move away and then tab back in. I haven't been able to find what's making the difference.
I don't think this has anything to do with tabbing into the control. It just determines how SelectAll works.
Wolven said: Regarding the Default Value... If it's a Numeric Editor, and it's set to Not Nullable, and there isn't any data in the field, Wouldn't it make sense that the value SHOULD be set to 0 (zero) automatically??? And if it's a Masked Edit control with a Numeric Input Mask and it's set to Not Nullable, and there isn't any data in the field, Wouldn't it make sense that the value SHOULD be set to 0 (zero) automatically???
No, 0 and null are not the same thing.
Mike said: No, 0 and null are not the same thing.
Apparently you missed the part about the control being set to NOT NULLABLE. If it's a NOT NULLABLE Numeric control or Input Mask and no value is entered then... Wouldn't it make REALLY GOOD LOGICAL sense that the value SHOULD be set to 0 (zero) automatically??? :)
Wolven said:Apparently you missed the part about the control being set to NOT NULLABLE. If it's a NOT NULLABLE Numeric control or Input Mask and no value is entered then... Wouldn't it make REALLY GOOD LOGICAL sense that the value SHOULD be set to 0 (zero) automatically??? :)
Hm, I did miss that part. But I'm still not sure that the control should assume that null is 0 when null is not allowed. I think a lot of time, Nullable is false because the developer wants to force the user to enter a value explicitly - not just assume that if they didn't enter anything it should default to 0.
Mike said: I think a lot of time, Nullable is false because the developer wants to force the user to enter a value explicitly - not just assume that if they didn't enter anything it should default to 0.
I think a lot of time, Nullable is false because the developer wants to force the user to enter a value explicitly - not just assume that if they didn't enter anything it should default to 0.
I would disagree with that. If I don't allow Null as a valid input, I'm most likely not allowing it as a valid value in the corresponding database field either. Consequently, the MINIMUM value to be stored would be 0, which WOULD be the default. If I was wanting to force the user to enter something, I would just test that the input value was greater than zero.
There seems to be a really big disconnect between "systems" level programmers (people like yourself) and real world business application programmers (people like me). In an accounting system, there is no such thing as null. Null simply means Nothing, which is EXACTLY what the numeric value of zero is. Zero tomatoes means there aren't any, Notta, Zilch, Zero, Nothing. We don't need ANOTHER value to represent the exact same thing.
Personally, I absolutely despise Null. It's just a pain in the butt. Except in extremely rare cases, (and NONE in accounting or any other business application I've ever written) it serves no purpose other than creating a whole lotta program errors and stupid test statements to insure that a value isn't null.
All that said, If Infragistics just can't bring themselves to agree that an emptly NON NULLABLE Numeric field should automatically default to 0, then AT LEAST give us the ability to set a Default Value, (which would be zero 99% of the time).
Wolven said:Personally, I absolutely despise Null. It's just a pain in the butt. Except in extremely rare cases, (and NONE in accounting or any other business application I've ever written) it serves no purpose other than creating a whole lotta program errors and stupid test statements to insure that a value isn't null.
Well, you can't blame Infragistics for that. Null is a feature of the programming language, and it's useful in many applications where you want to distinguish between an actual value and the absence of a value.
Wolven said:All that said, If Infragistics just can't bring themselves to agree that an emptly NON NULLABLE Numeric field should automatically default to 0, then AT LEAST give us the ability to set a Default Value, (which would be zero 99% of the time).
Feel free to Submit a feature request to Infragistics.