SPView.GroupByFooter property

Gets or sets the definition of the Group By footer that is used in the view.

Namespace:  Microsoft.SharePoint
Assembly:  Microsoft.SharePoint (in Microsoft.SharePoint.dll)

public string GroupByFooter { get; set; }

Property value

Type: System.String
A Collaborative Application Markup Language (CAML) string that contains the footer definition.

Setting values through the GroupByFooter property requires using the Update method for changes to take effect in the database.

The following code example uses the GroupByFooter property to customize the Group By footer area in a view and adds a link to a document library that is located

in the site.

SPSite oSiteCollection = SPContext.Current.Site;
using(SPWeb oWebsite = oSiteCollection.AllWebs["Website_Name"])
    SPList oList = oWebsite.Lists["List_Name"];
    SPView oView = oList.Views["View_Name"];

    oView.GroupByFooter = 
        "<Switch><Expr><GetVar Name=\"OnlyOneItem\" /></Expr>" + 
   "<Case Value=\"1\"><HTML><![CDATA[<td>&nbsp;</td>
      <td width=\"50%\">&nbsp;</td>]]>" +
   "</HTML><SetVar Name=\"OnlyOneItem\" Scope=\"Request\" 
      Value=\"0\" /></Case>" + 
   "</Switch><HTML><![CDATA[</TBODY>]]></HTML><Switch><Expr>" + 
   "<GetVar Name=\"GroupByIndent\" /></Expr><Case Value=\"0\"><HTML>" + 
   "<![CDATA[<TBODY id=\"foot]]></HTML>
      <GetVar Name=\"GroupByLevelString\" />" + 
   "<HTML><![CDATA[_\"><TR BORDERCOLOR=\"darkcyan\"><TD><BR></TD>" + 
   "<TD STYLE=\"border-style:double\" width=\"100%\" BGCOLOR=\"beige\"       class=\"ms-gb2\">" + 
   "<A href=\"/Site_Name/DocLib_Name\">      See Documents</A></TD></TR></TBODY>]]></HTML>" +
   "</Case><Default /></Switch><Switch><Expr>
      <GetVar Name=\"GroupByCollapse\" />" + 
   "</Expr><Case Value=\"TRUE\">
      <HTML><![CDATA[<SCRIPT>ExpCollGroup(']]></HTML>" + 
   "<GetVar Name=\"GroupByLevelString\" /><HTML>
      <![CDATA[','img_]]></HTML>" + 
   "<GetVar Name=\"GroupByLevelString\" /><HTML>
      <![CDATA[');</SCRIPT>]]></HTML>" + 
   "</Case><Default /></Switch>";

Certain objects implement the IDisposable interface, and you must avoid retaining these objects in memory after they are no longer needed. For information about good coding practices, see Disposing Objects.