Hi,
I am setting the MinValue and MaxValue for a cell in a grid with the help of BeforeCellActivate event.
However MaxValue is set correctly but MinValue is NOT set.
Eg: I have MaxValue as 1000 and MinValue as 10.
It is not allowing me to enter values more than 1000 which is correct but for MinValue it is allowing me to enter 9,8,7 etc.. till 0. The datatype of the column is Integer. Any workarounds?
Regards,
Viswanth V.G
Hi Viswanth,
When you say you can enter a value of 9, do you mean the user can type the number 9? Or so you mean they can type a 9 and then leave the cell with no error?
The grid has to allow the user to type in a single digit, because it doesn't have any way of knowing that they are not going to type any more digits. You have to be able to type "9" in order to type "90", for example. So the validation for MinValue in this case cannot occur until the user is done typing and tries to leave the cell.
Also, I wasn't aware that there is a MinValue or MaxValue on the cell, I though these prpoerties were on the column. Is that what you meant?
Mike,
Yeah! Got your point. I have set MinValue as 0 and MaxValue is 9, means, user cannot enter 10 (basically 2 digits) and the minimum value is 0 (baiscally non-negative). My actual problem was i have to set this to cells rather than columns. That is the reason why i was not able to validate.
Mike, is there any workaround to set the mask for a cell or a ultramaskeditor in a grid cell? I have a column called "Field" and each row would have different datatypes, one is double and other is int and date so on...If i change the datatype entire column is reset and date entered is converted to int and my head starts spinning..
Thanks,