Hello,
I am using a GridDataBoundGrid that has its DataSource propety set to an untyped DataView. This grid has a number of columns, most of which are displaying dollar values. Consequently, the StyleInfo.CellType property of each of these GridBoundColumns is set to "Currency".
What's causing me trouble is that for one of the columns, a value of 0 in the DataView is being displayed as an empty cell in the grid. I would like values of 0 to be displayed as "$0.00".
What makes this more puzzling is that the StyleInfo.CurrencyEdit.NullString property of the GridBoundColumn is set to "0.00". The help for this property reads "Specify the string to be displayed when the DecimalValue is 0", but, having tried various values, the property seems to have no effect.
What makes this still more puzzling is that the GridDataBoundGrid has other GridBoundColumns that also display currency values, and that have all of their properties set identically, as far as I can tell, to the GridBoundColumn that is displaying 0 values incorrectly. Yet these other columns display "$0.00" as desired.
Any ideas? Perhaps there's a property of the grid or the columns that I'm missing? I suppose I could handle the QueryCellFormattedText event of the grid and somehow convert all empty strings to 0s. But I'd prefer not to, for two reasons:
(1) I don't think it should be necessary, as the GridDataBoundGrid seems to already have the functionality that I'd like (and this therefore seems like a hack).
(2) While I am only aware of one column that has this problem at the moment, I suspect there are other columns on other grids in the application that have a similar problem, and I'd like to fix all of these problems at once.
Even handling the QueryCellFormattedText event has it owns problems. For some reason, in the event handler, GridCellTextEventArgs.style.CellType is set to "Textbox" rather than "Currency" (and CellValueType is null), so I can't identify which calls to the handler are for currency cells and which aren't. Additionally, the event handler doesn't seem to be called for all columns? (Printing out the value of GridCellTextEventArgs.style.CellIdentity. ColIndex shows several columns are missing.)
Thanks,
Justin
HA
haneefm
Syncfusion Team
November 22, 2007 03:51 PM UTC
Hi Justin,
Please try to provide us some more details on your system, as we need some more input on this issue. We have tested the attached sample with Essential Studio v5.2 to reproduce this issue. But we could not get this issue. Is it possible for you to provide us some more information to reproduce the issue here? This will help us to analyse the issue further.
We appreciate your patience, and thanks for considering Syncfusion products.
Best Regards,
Haneef