Hi all,
here's what I'm trying to do: I have a ultragrid, bound to a bindingsource, whose datasource is a datatable.
The data look like that:
...
I'd like to present it to the end user with some "clues" on the value cells.. for exemple, I'd like to show the difference in % from a year to another, or the difference of the value.. for exemple, instead of just showing "1000" for the row "2009"/Jan column, I'd like to say something like "+20%" or "+200€", change the appearance of the cell to reflect the fact that the value has grown ...
How could I achieve that using the ultragrid built-in features ? Do I have to add bands, or rows or columns (and use groups, row layout etc.) ? To I have to use a calcManager or loop through the rows and columns (the old way) to calculate those values ?
Could someone please point me in the right direction ? Any help would be greatly appreciated, thank you in advance !
François
Hi François,
What I would do is add some unbound columns to the grid. You could use the InitializeLayout event of the grid and add an unbound column to the band using band.Columns.Add. You could use the column.Header.VisiblePosition to place this column in between Jan and Feb.
To assign a value to this column, you could use UltraCalcManager and assign a formula to the column. Or, you could use the InitializeRow event and populate the value of the cell in code there.
InitializeRow is also a good place to apply a color to a cell based on a value in the cell or in the same row.