To access to the computed footer of a GridView, you have to use the index of the column (starting from 0
), and get the first Label
control, since the control doesn’t have an ID .
It is best to call this function at Page_LoadComplete
in case you have a =SUM
in the footer, since the calculation occurs after the Page_Load
event.
This example will get the footer value of the third column:
protected void Page_LoadComplete(object sender, EventArgs e)
{
TEXTBOX_ID.Text = (REQUEST_GRIDVIEW1.FooterRow.Cells[2].Controls[0] as Label).Text;
}