Changing the footer text in GridView
<p>I can't seem to be able to change the footer text.  I've tried the sorted event as well but nothing happens.  All I want to do is display status messages.  Here is my code:</p>

<pre><code>protected void PageSettings_Sorting(object sender, GridViewSortEventArgs e)
{
  if (((GridView)sender).EditIndex &gt; -1)
  {
    e.Cancel = true;
  }
  else
  {
    // tried this on sorted aswell but can't change footer text
    GridViewRow row = ((GridView)sender).FooterRow as GridViewRow;
    Label lblStatus = new Label{ ID="lblStatus", Text="Sorting Column &lt;b&gt;\"" + e.SortExpression + "\" " + e.SortDirection + "&lt;/b&gt;"};
    row.Cells[0].Text = "Hello World"; //.Controls.Add(lblStatus);            
  }
}

protected void PageSettings_RowCreated(object sender, GridViewRowEventArgs e)
{
  if (e.Row != null &amp;&amp; e.Row.RowType == DataControlRowType.Header)
  {

  }
  else if (e.Row != null &amp;&amp; e.Row.RowType == DataControlRowType.Footer)
  {
    int count = e.Row.Cells.Count;
    for (int i = count - 1; i &gt;= 1; i += -1)
    {
      e.Row.Cells.RemoveAt(i);
    }
    e.Row.Cells[0].ColumnSpan = count;
    e.Row.Cells[0].Controls.Add(new Literal { ID = "lblStatus" });
    // can't FindControl or change Literals either
    e.Row.Cells[0].Text = "Hello World"; // works here but not on sorting event
  }        
}

&lt;asp:GridView ID="PageSettings" runat="server"
     AllowPaging="true" AllowSorting="true"
     AutoGenerateColumns="false"
     AutoGenerateDeleteButton="true"
     AutoGenerateEditButton="true"
     ShowFooter="true" 
     DataSourceID="ObjectDataSourcePages"
     OnLoad="PageSettings_Load" 
     OnRowDataBound="PageSettings_DataBound"
     OnRowCreated="PageSettings_RowCreated"
     OnRowEditing="PageSettings_RowEditing" 
     OnRowCancelingEdit="PageSettings_RowCancelingEdit"      
     OnPageIndexChanging="PageSettings_PageIndexChanging"
     OnSorting="PageSettings_Sorting" 
     OnSorted="PageSetting_Sorted"    
     PageSize="2"&gt;        
  &lt;Columns&gt;
    &lt;asp:TemplateField HeaderText="Page Name" HeaderStyle-HorizontalAlign="Left" SortExpression="Name"&gt;
      &lt;ItemTemplate&gt;
        &lt;%# Eval("Name") %&gt;
      &lt;/ItemTemplate&gt;
      &lt;EditItemTemplate&gt;
        &lt;asp:TextBox ID="Name" runat="server" Text='&lt;%# Bind("Name") %&gt;'&gt;&lt;/asp:TextBox&gt;
      &lt;/EditItemTemplate&gt;                
    &lt;/asp:TemplateField&gt;
    &lt;asp:TemplateField HeaderText="Path" HeaderStyle-HorizontalAlign="Left" SortExpression="Path"&gt;
      &lt;ItemTemplate&gt;
        &lt;%# Eval("Path") %&gt;
      &lt;/ItemTemplate&gt;
      &lt;EditItemTemplate&gt;                    
        &lt;asp:TextBox ID="Path" runat="server" Text='&lt;%# Bind("Path") %&gt;'&gt;&lt;/asp:TextBox&gt;
      &lt;/EditItemTemplate&gt;
    &lt;/asp:TemplateField&gt;
    &lt;asp:TemplateField HeaderText="Route Value" HeaderStyle-HorizontalAlign="Left" SortExpression="RouteValue"&gt;
      &lt;ItemTemplate&gt;
        &lt;%# Eval("RouteValue") %&gt;
      &lt;/ItemTemplate&gt;
      &lt;EditItemTemplate&gt;
        &lt;asp:TextBox ID="RouteValue" runat="server" Text='&lt;%# Bind("RouteValue") %&gt;'&gt;&lt;/asp:TextBox&gt;
      &lt;/EditItemTemplate&gt;
    &lt;/asp:TemplateField&gt;
    &lt;asp:TemplateField HeaderText="RegExp" HeaderStyle-HorizontalAlign="Left" SortExpression="RegExp"&gt;
      &lt;ItemTemplate&gt;
        &lt;%# Eval("RegExp") %&gt;
      &lt;/ItemTemplate&gt;
      &lt;EditItemTemplate&gt;
        &lt;asp:TextBox ID="RegExp" runat="server" Text='&lt;%# Bind("RegExp") %&gt;'&gt;&lt;/asp:TextBox&gt;
      &lt;/EditItemTemplate&gt;
    &lt;/asp:TemplateField&gt;
  &lt;/Columns&gt;                
&lt;/asp:GridView&gt;
</code></pre>
