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
I don't understand. Are you saying that you are setting the editor of a cell in one row and it's affecting the cells in the other rows? I don't see how that's possible.
It sounds to me like you are still setting the mask or editor properties of the column and not the cell.
I tried that prior to my post and unfortunately since my grid is created at runtime i have same column name. My grid looks like this..
DataElement <some columns hidden> Value(user would enter)
Name: Mike
DoB: 06/02/1970
Salary: $10000.50
Now, if i use a mask (double) for salary, DoB value is getting rearranged as 06.02 (it applies to all the fields as the column name is NOT unique).
Hope i'm clear this time. Any suggestions?
Thanks Mike.
Maybe I wasn't clear in my previous post. I was explaining how you apply a different mask to each cell. Not to the column.
That was what you asked and that was what my answer explained how to do.
You have to use an editor for that. You don't set the mask on the grid column. You set it on the editor. Then you apply the editor to the cell.
Mike,
The problem is, i have a data driven UI and i have the datatypes coming from db. So based on the datatypes i would set the column style, the caveat's are:
1. My column name is Field and is the same for all, means only the cell's datatype has to differ and not columns' datatype.
2. I cannot set the InputMask as it applies for a column and all the entered values get reformatted as specified in the mask.
3. I cannot set the MaskInput anywhere in the grid event as it re-sets the previous style..
Have implemented a cumbersome logic which is working fine, but for double datatypes is there a way to increase the decimal values to 5 instead of the default 2. What it does is, it doesn't allow me to enter more than 2 decimals where as my min value is sometimes 0.00001. It allows only xxxx.00.
Need help..
You can apply a different mask on each cell using editors. What you would do is set the column's UseEditorMaskSettings property to true. Then you assign an Editor or EditorControl to the column that has the masking you want. For example, you could use the UltraMaskedEditor control or the UtraNumericEditor.
The InitializeRow event is usually a good place to do this.
I'm not sure if this applies to the MinValue or MaxValue, though. Those are not part of the mask, so I don't know if the grid picks those up from the editor.