Update: if you use the formatter as 'n' for number, it works fine...!
The data I am getting from the database is in the RAW format. For example, if I am tracking the price of the item, it will be 23.45343 . I need to display in the form of 23.45.
I also need to take care of the rounding the values. Also, adding ',' for every thousands e.g. 1,000,000.01 But I do not need currency specifier along with it. e.g. $. I can add formats such as c, d. But I need the currency specifier removed.
I also need to handle percentages, to show, 2.1 as 2.1%
Now, I can use 'p' to format it as %, but the problem here is the data I am getting from the DB is already in %. But the number doesnt have the % sign, which I need to add to the cells.
Is it possible to do that? If yes, how?
Another Update:
The datetime data I am getting from the database is like this: "Fri Sep 05 00:00:00 EDT 2008"
I need to convert it to MM/dd/yyyy format. I have tried using format strings like d,g,etc. But I am not able to format it. Is there any way where we can manually format the data of the column?
I'll really appreciate your help in this regards.
Thanks :)
I'd stripped out the dollar signs, was mostly looking for the "-" for zero amounts. Here's the corrected example.
"_($* #,##0.00_);_($* -#,##0.00;_($* \"-\"??_);_(@_)"
In C# you can do the fomatting like this:
"_(#,##0.0%_);_((#,##0.0%);_(\"-\"??_);_(@_)"
Note the "\" before the quotes inside the format string. That solves the problem of the double "".
Hi,
You could apply different masks to cells in the same column using an editor. What you would do is place two UltraMaskEdit controls on the form with the grid. Then you set up the two control with different masks so that one allows negative numbers and the other does not.
Set the UseEditorMaskSettings property on the column to true so that the column knows to ignore it's own property setting in favor of the editor settings.
Then you use the InitializeRow event of the grid to assign the EditorControl of the cell in the row one or the other of the UltraMaskEdit controls.
Hi
Same column with positive and negative values
i have to enter negative values only in a cell for the particular rows.
and then i have to enter positive values only in the cell for other rows.
is any option in ultragrid?
Thanks Mike