冻结的最后一行DataGridView作为列的总和?

Gol*_*old 11 .net c# datagridview winforms

是否可以将a的最后一行DataGridView作为列的总和,并且最后一行始终显示/被冻结?

Nas*_*loo -3

为此,您必须将ShowFooter属性设置为True

然后在代码后面的页脚中添加您想要的值


   <asp:GridView ID="grdList" runat="server" ShowFooter="True" >
   // other part of gridview codes e.g columns or blah blah blah
   </asp:GridView>

   // in code-behind
   int totalValue = 2 * 10;
   grdList.Columns[2].FooterText = totalValue.ToString();
Run Code Online (Sandbox Code Playgroud)

  • @Gold 正在谈论 Winform `DataGridView` 并且您建议使用 ASP.Net `GridView` 代码。 (2认同)