I am looking to add a simple math column in Gridview.
basically take the results of Column2 and divide by the number in Column1.
I think this should be simple but I have not found the info searching around.
Column1 = punt_ret_no
Column2 = punt_ret_yds
Column2 = [punt_ret_yds] / [punt_ret_no]
Just for the thread here are my coumns
Code:<asp:GridView ID="GridView1" AllowSorting="true" runat="server" DataSourceID="SqlDataSource1" OnRowDataBound="GridView1_RowDataBound" SkinID="booksSkin" AutoGenerateColumns="False" HorizontalAlign="Left"> <Columns> <asp:BoundField HeaderText="Punt Returns/gm" DataField="punt_ret_no" ItemStyle-HorizontalAlign="Center"/> <asp:BoundField HeaderText="Return Yards/gm" DataField="punt_ret_yds" ItemStyle-HorizontalAlign="Center"/> </Columns> </asp:GridView> <asp:SqlDataSource ID="SqlDataSource1" runat="server" SelectCommand="SELECT [punt_ret_no], [punt_ret_yds] FROM [team_avg] ORDER BY [punt_ret_yds] DESC" ConnectionString="<%$ ConnectionStrings:ConnectionString1 %>" />




Reply With Quote