Hi,
I am creating a dynamic grid cell which may have numeric editor or text editor or combo etc,
My code is below to create the dynamic numeric editor control. This editor control has _ and not able to see the entered text while focus.
UltraNumericEditor num = new UltraNumericEditor(); num.Nullable = true; num.PromptChar = ' '; num.Appearance.TextHAlign = HAlign.Left; num.NumericType = NumericType.Double; num.FormatString = "0.00"; num.MaxValue = 9999999.99; num.MinValue = -9999999.99; ugr.Cells["Value"].EditorComponent = num;
Need to use the numeric editor without _ or spaces. the entered text should show while focus
Thanks,
Dhanasekaran
thanks for the reply. i can go with text editor instead of numeric editor.
Hello Dhanasekaran,
I am just checking about the progress of this issue. Let me know if you need my further assistance on this issue.
Thank you for using Infragistics Components.
Hi Dhanasekaran,
Thank you for the clarification.
The Masked Editor, which is used by the UltraNumericEditor, provides a visual queue to the user as to how many symbols they are allowed to enter. This is determined by the MaskInput property and it is visualized by the PromptChar property. In your case, the PromptChar is a white space and this is why you have the blank spaces to your value. This can’t be turned off as it is a core functionality of the Masked Editors. You can limit this by specifying the MaskInput, specifying a smaller amount of allowed values. This is what I suggested in my previous reply. You can view more about the MaskInput property if you follow this link:
http://help.infragistics.com/Help/Doc/WinForms/2011.1/CLR2.0/html/Infragistics2.Win.UltraWinGrid.v11.1~Infragistics.Win.UltraWinGrid.UltraGridColumn~MaskInput.html
If you don’t want to have any PromptChars you shouldn’t assign a numeric editor to the grid. Instead use the default editor, which doesn’t support masking and it won’t display any additional characters.
Please let me know if you have any additional questions.
i want to have my numeric editor control to be empty (no spaces) initially. after i enter a number, it should show only the number. for example:
initial view --> "" not like " "
after enter number --> "253456" not like "253456 "
before set the PromptChar it was like "253456______________"
hope you understand my need.
I am not sure what exactly do you mean by that. Do you want the user to be unable to type more than a certain amount of symbols? If that is the case, you can use the MaskInput property of the column:
grid.DisplayLayout.Bands[bandKeyOrIndex].Column[“Value”].MaskInput = "n.nn";
If this is not what you want please clarify your question and your end goal and I will be glad to help you achieve it.
I am looking forward to hearing from you.