Is it possible to put a conditional formatting on summary values?
i.e. for a normal column:
universeGrid.DisplayLayout.Bands[0].Columns["Total"].ValueBasedAppearance = ....;
Can be defined conditionally, but there doesnt seem to be a way to define forecolor conditionally only:
SummarySettings summary = ......;
summary.Appearance.ForeColor = ....
Hi,
I don't think ValueBasedAppearances are supported for summaries currently, You should Submit a feature request to Infragistics.
In the mean time, I would recomend using the AfterSummaryValueChanged event and you can apply an appearance to the summary based on the value.
Hi Mike,
I am using ultrawingrid. I have summary row in the grid. I want the sum the cell value based on the value in some other cell. Is it possible to set condition for summary values in grid?
I don't know of any samples, but you might wan to try searching the forums and see if there have been any samples posted here.
It's pretty simple. There are only three methods on the interface. The first is called when the summary calculation begins, so this gives you a change to initialize any variables you will need. Then there's a method which is called for each summary in the collection of rows being summarized. Then the final method fires after all of the rows have been processed so you can return a value.
Mike,
Is there any sample code to use ICustomSummaryCalculator and handle the calculation of the grid conditional summary ?
Are you using the grid's built-in summaries? Or are you using formulas?
There are two ways to do a conditional summary:
1) You could write an ICustomSummaryCalculator and handle the calculation of the summary n code.
2) You could do it as a two step process. For example, support I have two fields in the grid, a bool and an int, and I want to sum the int column only where the bool is true. What I would do is add a hidden unbound column to the grid and use the InitializeRow event to populate this column with the value of the int when the bool is true, and 0 when the bool is false. Then I can sum up the hidden column.