I have a data grid with (amongst others) a numeric column. Each or it's rows has been bound to an instance of a LevelDataRow using the grid's ItemsSource property. The column's column mapping has been bound to a property called Spill. So the column definition currently looks like this:-
xaml Code:
<sf:GridNumericColumn HeaderText="Spill (Ml/d)" AllowEditing="True" NumberDecimalDigits="2" MappingName="Spill" CellStyle="{StaticResource SpillCellStyle}" MinValue="0" MaxValue="9999"/>
The thing is the Max value should not be a static value of 9999. It needs to be a dynamic value calculated for each Row. A simple property to calculate the MaxValue would like this:-
C# Code:
public double MaxSpill { get { return Volume - m_reservoirWrapper.Capacity; } }
I can't seem to work out how use that function to set the MaxValue on the column. Something a bit like this:-
xaml Code:
<sf:GridNumericColumn HeaderText="Spill (Ml/d)" AllowEditing="True" NumberDecimalDigits="2" MappingName="Spill" CellStyle="{StaticResource SpillCellStyle}" MinValue="0" MaxValue="{Binding Path=MaxSpill, Mode=OneWay}"/>
Any suggestions?