我有一个页脚gridview,并显示在页脚价格列的总数。我想要访问页脚中的值并将其显示在gridview外部的文本框中。需要在gridview外的文本框gridview中的页脚总数
这是我的GridView的外观仅页脚模板
<asp:TemplateField HeaderText="Total" >
<ItemTemplate>
<asp:Label ID="lbltotal" runat="server" Text='' ></asp:Label>
</ItemTemplate>
<FooterTemplate>
<asp:Label ID="lbltotalprice" runat="server" Text=''></asp:Label>
</FooterTemplate>
</asp:TemplateField>
下面就是我如何在页脚中显示总
In gridview rowdatabound event
if (e.Row.RowType == DataControlRowType.Footer)
{
Label amounttotal = (Label)e.Row.FindControl("lbltotalprice");
amounttotal.Text = String.Format("{0:C2}", total);
}
我试图在以下方式中的另一种方法
GridViewRow row = GridView1.FooterRow;
Total.Text= ((Label)row.FindControl("lbltotalprice")).ToString();--- does not help at all
请在texbox gridview的外部访问在页脚这个值帮助。 在此先感谢。