Renderer for grouping grid

Hi, I have a grouping grid in which the format of a cell is "$#,##0;($#,##0);-" 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 End If End If Can you help?

1 Reply

AD Administrator Syncfusion Team April 16, 2005 09:32 AM UTC

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. ggc_zero_419.zip

Loader.
Up arrow icon