The DevExpress Grid (XtraGrid) allows grids and their groups to have summary calculations. The available options are Count, Max, Min, Avg, Sum, None and Custom.
Has anyone got some sample code that shows how to calculate a weighted average column, based upon the weightings provided as values in another column?
Best Answer
I ended up working this out, and will post my solution here in case others find it useful.
If a weighted average consists of both a value and a weight per row, then column that contains the value should have the weight GridColumn object assigned to its Tag property. Then, this event handler will do the rest:
The code assumes that the underlying column values can be converted to doubles via
Convert.ToDouble(object)
.