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
Hi Dhanasekaran,
Thank you for posting in our forums.
The cell in the grid will use the PromptChar specified on its column, not the PromptChar specified on its EditorComponent. As the PromptChar by default is “_” you see this symbol as the prompt char when you are editing the cell. What you can do in this case is to set the prompt char to “ ” on the column itself:
grid.DisplayLayout.Bands[bandKeyOrIndex].Column[“Value”].PromptChar = ‘ ’;
Please let me know if you have any additional questions.
Thanks for the reply. The solution works for _ but I am still seeing blank spaces.
How to avoid the blank space?
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.
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.
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.
thanks for the reply. i can go with text editor instead of numeric editor.