When the data layer does not allow to perform calculations we often need to harness the UI.
Here is a a simple case - in our business object we have the Price and the Count properties. We will have RadGridView to calculate the Total for us in a calculated column.
If you peek into the sample project you will notice we are using a pretty standard Silverlight approach :
We bind the value of the calculated column with a Binding Converter :
<telerik:GridViewDataColumn
Header="Total"
Background="Bisque"
DataMemberBinding="{Binding Converter={StaticResource CalculatingConverter}}" TextAlignment="Right" />
The calculation “logic” is in the Convert method of CalculatingConverter.cs
public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
...