How can you get a reference to the underlying object (TValue) within a GridAggregateColumn? The value is the result of calculating two different fields.
<GridAggregateColumn Field=@nameof(Models.Position.Gains) Type="AggregateType.Custom">
<FooterTemplate>
@{
// Need a reference to the Models.Position? The result will be displayed in this column
var percentage = context.Gains / context.Cost;
<div>
@percentage.ToString("P2")
</div>
}
</FooterTemplate>
<GroupFooterTemplate>
@{
// Need a reference to the Models.Position?
var percentage = context.Gains / context.Cost;
<div>
@percentage.ToString("P2")
</div>
}
</GroupFooterTemplate>
</GridAggregateColumn>