Hi,
I have a UltraWebGrid where its values can be modified through the grid's Row Edit Template.
I have few columns in UltraWebGrid where each them has the DataType "System.Decimal". If the decimal values in these columns are too small, it displays an exponential value on the field in Row Edit Template.
For example:- If the value in the grid is 0.000001 (six decimals), then it'll populate 0.000001 onto the field in Row Edit Template. This is OK. - But, if the value in the grid is 0.0000001 (seven decimals), then it'll populate 1e-7 onto the field in Row Edit Template. Not OK.
Another wierd thing happens When I try to update the small decimal value back to the grid and trigger the "UpdateRow" server event. The value returned from the particular cell is "False" rather than the number itself. It's not even the number in exponential expression.
For example, in grid's UpdateRow event:If the cell value is 0.000001(six decimals), then e.Row.Cells(0).Value ==> 0.000001 (OK)
But, If the cell value is 0.0000001 (or 1e-7, seven decimals) e.Row.Cells(0).Value ==> False
Is this a bug?
So, my question is...For small decimal number,
1) Is there a way for me to display the actual number (not the exponential value) onto field in Row Edit Template?
2) And instead of "False", how can I get the modified number in grid's UpdateRow event?
Please don't tell me to change the column's datatype to String.
Use a WebNumericEditor and set the web grid column's editor to it. There should be some examples of how to do this...in one of our apps, we require display of at least 20 decimal places which the WebNumericEditor allows.
The editor also helps in that it validates the keys pressed and only allows numeric characters into the cell.
Thanks, but I am already using a WebNumericEdit control.
The problem is not on the number of decimal places it can support, but rather the Value of the decimal number.
For example agian...
if the decimal number is 20.00000000000000001. I have no problem getting 20.00000000000000001 form the grid's cell in code behind.
But, if the decimal number is 0.00000001, it will return "False" in code behind when you try to get the value from the grid's cell.