Gridview and sorting a calculated Row (How?)

markm75

Newcomer
Joined
Jan 16, 2006
Messages
15
I have a row which is calculated, its not bound to my sql database as are the others. I simply want to be able to click on this column and have it sort the values.

This is my code:
<asp:TemplateField HeaderText="AVG" SortExpression="AVG" >
<ItemTemplate>
<asp:Label id="AVG" Runat="Server" Text='<%# average(Convert.ToDecimal(Eval("H")), Convert.ToDecimal(Eval("AB"))) %> ' />
</ItemTemplate>
<FooterTemplate>
 <asp:Label Text='<%# Get_TotalAvg() %>' runat="Server" />
</FooterTemplate>
</asp:TemplateField>

The web page returns an error stating it can't find the column AVG. I cant seem to find a workaround to this situation. Anyone know of a solution.

Thanks
 
Back
Top