0
Answer

input MASK for datagrid

deepa

deepa

19y
4.8k
1
hi,
i'm using Component One TrueDBGrid in my form.
one of the columns is the "Amount" field. ItShould allow users to enter only integers or float type. But if he attempts to enter characters, error provider should be shown..this will be done in RowColChange event of the grid...so he shuld not be able to enter any characters or special characters..
Please tell me how i'll do this...i tried using the EditMask property of the grid i.e.
tdbgridOnewayReturn.Splits[0].DisplayColumn[3].DataColumn.EditMask = "0000000.00";
but this doesn't take decimal..if i enter 0000332.99, then it saves as 3329900..which is not correct.
But if i use NumberFormat property of the grid :
tdbgridOnewayReturn.Splits[0].DisplayColumns[3].DataColumn.NumberFormat = "Fixed";

then,the user can also enter characters..which is not correct..
please do tell me how i'll resolve this problem....
thanx ..