Share via


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)

Syntax

Public Property GroupByFooter As String
    Get
    Set

Dim instance As SPView
Dim value As String

value = instance.GroupByFooter

instance.GroupByFooter = value
public string GroupByFooter { get; set; }

Property Value

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

Remarks

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

Examples

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.

Dim siteColl As SPSite = SPControl.GetContextSite(Context)
Dim site As SPWeb = siteColl.AllWebs("Site_Name")
Dim list As SPList = site.Lists("List_Name")
Dim view As SPView = list.Views("View_Name")

view.GroupByFooter = 
        "<Switch><Expr><GetVar Name='OnlyOneItem' /></Expr>" _
    & "<Case Value='1'><HTML><![CDATA[<td>&amp;nbsp;</td>
        <td width='50%'>&amp;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>&lt;BR&gt;</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>"

view.Update()
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>";
    oView.Update();
}

Note

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 Best Practices: Using Disposable Windows SharePoint Services Objects.

See Also

Reference

SPView Class

SPView Members

Microsoft.SharePoint Namespace