I have a grouping grid in which the format of a cell is
Which means the value will be
$1,000 or ($1,000) or -
The problem is, when then value becomes 0 i''d like for it to display -
But the grid displays this error message:
"- is not a valid value for Decimal"
I have worked out that in the standard databound grid i can overwrite the controlvalue/controltext property with the cellvalidating event by hooking into the GridDataBoundGrid.CurrentCell.Renderer (GridTextBoxCellRenderer) of the control and when the format changes a 0 to a - (dash) it doesnt display an error.
But I haven''t found a way to do it in the grouping grid.
I''ve tried this:
If Not StorageRentDataGrid.TableControl.CurrentCell.Renderer Is Nothing Then
Dim ccRender As GridTextBoxCellRenderer = StorageRentDataGrid.TableControl.CurrentCell.Renderer
If ccRender.Control.Text = "-" Then
ccRender.Control.Text = 0
Can you help?
ADAdministrator Syncfusion Team April 16, 2005 04:32 AM
Below is a link for a little sample and here is the behavior I see in it.
If the data already has a zero in it, then just setting the format was engough to get the desired display.
If I type a zero into a cell, the display is also okay just setting the format.
But if I type a minus sign into the cell, then I do see an eception only using the format. If you want your user to be able to type a minus and have it actually put the value zero into the datasource (and hence make the formatted cell display - ), then you can handle the model.SaveCellFormattedText to do this. This event is shown in the sample.