Hi
I am using Ultrawin grid. I have a column where the user will enter currency value.
Grid should allow the user to enter only numeric values and currency symbol(Only at first position)
Grid should NOT allow the user to enter any special characters or alphabets
User has to type $1300400
After the user moves out of the cell it should display the value as $1,300,400
How to do the validation and set the comma separated format on a UltraWin Grid cell?
Thanks
Ashok
Hello,
In order to set the appearance of the values you can set thr Column's Format property like so:
ultraGrid1.DisplayLayout.Bands[0].Columns[1].Format = "$#,###.##";
and there is a RegexPattern property you can set to validate the cell's input
ultraGrid1.DisplayLayout.Bands[0].Columns[1].RegexPattern
Hope this helps.
Sincerely,
Petar Monov
Developer Support Engineer,
Infragistics, Inc
Hi,
I tried your solution but it did not work.
I added
ultraGrid1.DisplayLayout.Bands[0].Columns[5].Format =
"$#,###.##";
to my form load and it still not in the currecy format
Format only affects cells that are not in edit mode, it has no effect on a cell in edit mode, nor does it do any validation or masking.
When a cell is in edit mode, you should use the MaskInput on the column to limit the input.Or, if you want to do it the easy way, set the Style property on the column and this will apply a default currency mask for you.
MaskInput property can be used with COLUMN only. is there a way to use this property with CELL?
i have a CELL with Currency style. and want to change its MaskInput.
There are no masking properties directly on the cell. But what you can do is use an editor. Set the UseEditorMaskInfo property on the column to true.
Then set the EditorControl property on the cell to an editor control, like UltraCurrencyEditor that has the masking set up the way you want it.
currency return from database is in format nnn,nnn,nnn,nnn,nnn.nn but maxValue shud not exeed 999,999,999,999,999/999,999,999,999.99(15 chars length) while edit. so setting MaskInput to nnn,nnn,nnn,nnn,nnn.nn allows max. value 999,999,999,999,999.99 ; so difference of .99 ...any solution?
(*if i enter 999,999,999,999,999 as an input, it store in database and while loading from database it returns in format like 999,999,999,999,999.00)
You cannot set a MinValue or MaxValue on an individual cell in the grid.
One thing you could try is using UltraControlContainerEditor. This component allows you to place a control in a cell. So you could, for example, use an UltraCurrencyEditor that is not attached to the cell or column directly, but is instead embedded in the grid as a control. That way, you could set up it's mask, MinValue, and MaxValue separately.