Form designer: Gridview: .Net: How to retrieve a column's footer value?


#1

To access to the computed footer of a gridview, you have to use the index of the the column (start at 0) and get the first Label control (because the control doesn’t have an Id) .

e.g: For the 3rd column

It is best to call this function at Page_LoadComplete in case you are doing an =SUM in the footer since the calculation occurs after the Page_Load event.

protected void Page_LoadComplete(object sender, EventArgs e)
    {
       TEXTBOX_ID.Text = (REQUEST_GRIDVIEW1.FooterRow.Cells[2].Controls[0] as Label).Text;
    }