We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

GridDataBoundGrid has empty cells instead of "$0.00"

Thread ID:

Created:

Updated:

Platform:

Replies:

70006 Nov 22,2007 01:10 AM Nov 22,2007 10:51 AM Windows Forms 1
loading
Tags: GridControl
Justin
Asked On November 22, 2007 01:10 AM

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



haneefm [Syncfusion]
Replied On November 22, 2007 10:51 AM

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


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;