Hi,
I'd like to format one of my columns with a thousand separator. I also would like to not show any decimal places. So I want my numeric values to look like:
1001,1004,555,111
How can I achieve that?
What do you think, is it possible to remove the PromptChar (to be empty chart instead of '_') and using MaskInput = nnnnnnnn.nn
Regards
Yes, I will explain.
Using the input mask of nnnnn.nn will create a line in edit mode that is 5 digits long on the left of the decimal and 2 digits long on the right of it. the right is fine. I'd like to be able to input a random number of digits on the left. Meaning, that placeholder line that shows up should not restrict me to the number of digits I set in the mask.
To demonstrate:
Using this mask nn.nn will create a placeholder in the cell's edit mode that looks like __.__ that will only allow me to put two digits on either side.Using this mask nnnnn.nn will create a placeholder in the cell's edit mode that looks like _____.__ that will allow me to put 5 digits on the left.
I am looking for somthing like #.nn where # can be any number of digits.
I`m not sure that I understand well your request. Do you mean arbitrary number of digits after decimal separator? If so, you could use a mask
ultraGrid1.DisplayLayout.Bands[0].Columns["Double"].MaskInput ="{double:9.4}"; which define the number of digits before and after decimal separator. The MaskInput property define the behavior during the cell is in Edit mode, so if you think that your scenario didn`t required such functionality you could use only Format property (without MaskInput property).
Please let me know if you think that I misunderstand your question or if you have any further questions.
That works, but can I have an arbitrary number of digits for the mask?
Hello Khaled,
If I understand well your requirements, maybe you could try :
ultraGrid1.DisplayLayout.Bands[0].Columns["Double"].MaskInput = "nnnnnnn.nn";
ultraGrid1.DisplayLayout.Bands[0].Columns["Double"].Format = "###,###.00";
Please take a look at the atatched video file for more details and let me know if you have any questions.