怎么在dataGrid的最后一行加统计行啊,不写入数据库,在更新dataGrid的时候,不把最后一行写入数据库,只起到统计显示的作用,最好是写到一个函数里,因为我有三个dataGrid,当某个dataGrid的visible为真时,就执行这个函数里对应的语句给个完整些的代码,高手们,帮帮啦

解决方案 »

  1.   

    在datagrid生成的table插入一行即可
      

  2.   

    <form id="form1" runat="server">
        <div>
        <asp:DataGrid  ID="mygrid" runat="server" Width="800px"></asp:DataGrid>
        <table cellspacing="0" rules="all" border="1" id="Table1" style="width:800px;border-collapse:collapse;">//这个table标签和你的datagrid生成的table的属性一至。    <tr>
        <td>合计<% 你要邦定的合计字段 %></td>
        <td>合计<% 你要邦定的合计字段 %></td>
        <td>合计<% 你要邦定的合计字段 %></td>
        ……
        </tr>
        </table>
        </div>
        </form>