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.
Syncfusion Feedback

Renderer for grouping grid

Thread ID:

Created:

Updated:

Platform:

Replies:

27726 Apr 16,2005 08:39 AM UTC Apr 16,2005 09:32 AM UTC Windows Forms 1
loading
Tags: Grouping
Carolyn Jones
Asked On April 16, 2005 08:39 AM UTC

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?

Administrator [Syncfusion]
Replied On 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

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.

Warning Icon 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.Close Icon

;