日期:2014-05-17 浏览次数:20924 次
private decimal thisTotal=0;//本页面合计 private decimal total=0;//共计然后在GridViewShow()函数中计算出这些值。自定义函数GridViewShow()用于实现GridView的数据绑定。
<asp:GridView ID="GridView1" AutoGenerateColumns="false" DataKeyNames="ID" runat="server" OnRowDataBound="GridView1_RowDataBound" ShowFooter="True"> <RowStyle BackColor="#ffffff" /> <AlternatingRowStyle BackColor="#fffef9" /> <Columns> <asp:TemplateField> <HeaderTemplate> <input type="checkbox" name="BoxIdAll" id="BoxIdAll" onclick="onclicksel();" /> </HeaderTemplate> <ItemTemplate> <input id="BoxId" name="BoxId" value='<%#(Convert.ToString(Eval("ID")))%>' type="checkbox" /> </ItemTemplate> <ItemStyle Height="23px" HorizontalAlign="Center" /> <HeaderStyle Width="3%" BackColor="#80B4CF" Height="25px" /> </asp:TemplateField> <asp:TemplateField HeaderText="序号"> <ItemTemplate> <font color="#000000" style="font-size: 10px"> <%#GetCount()%> </font> </ItemTemplate> <ItemStyle HorizontalAlign="Center" /> <HeaderStyle Width="5%" BackColor="#80B4CF" HorizontalAlign="Center" /> </asp:TemplateField> <asp:TemplateField HeaderText="单位"> <ItemTemplate> <font style="font-size: 11px"> <%#strTrim(Convert.ToString(Eval("BranchName")))%> </font> </ItemTemplate> <ItemStyle HorizontalAlign="Center" /> <HeaderStyle HorizontalAlign="center" Width="17%" BackColor="#80B4CF" /> </asp:TemplateField> <asp:TemplateField HeaderText="类别"> <ItemTemplate> <font style="font-size: 11px"> <%#getZLB(Convert.ToString(Eval("FYXM")))%> </font>