ComponentOne GridView for ASP.NET WebForms
Task-Based Help / Formatting the Grid's Content / Setting the Footer Text
In This Topic
    Setting the Footer Text
    In This Topic

    This topic demonstrates how to show a footer and set its text in C1GridView at design time and programmatically.

    In the Designer

    Complete the following steps:

    1. Right-click the C1GridView control and then click Show Smart Tag. On the C1GridView Tasks menu, click Property builder. The C1GridView Properties window appears.
    2. On the General tab, check the Show footer check box.
    3. Select the Columns tab and deselect Create columns automatically at run time if it is selected.
    4. Choose a column in the list of Selected columns.
    5. Enter the desired text in the FooterText property.

    In Source View

    Switch to Source view and complete the following: steps:

    1. Set the following text to the <cc1:C1GridView> tag:
      It will appear similar to the following:
      <cc1:C1GridView ID="C1GridView1" runat="server" DataSourceID="AccessDataSource1" AutogenerateColumns="False" ShowFooter="True">
      
    2. Set the footer text for individual columns using the FooterText property by adding the following FooterText="Total Price" text within a <cc1:C1BoundField> tag, so it appears similar to the following:
      <cc1:C1BoundField DataField="ProductName" HeaderText="ProductName" SortExpression="ProductName" FooterText="Footer">
      
      This will set the FooterText property.

    In Code

    Open the Code Editor and set the following properties in code:

    For example, add the following code to the Page_Load event:

    To write the code in Visual Basic:

    Visual Basic
    Copy Code
    C1GridView1.AutoGenerateColumns = False
     C1GridView1.ShowFooter = True
     C1GridView1.Columns(0).FooterText = "Footer"

    To write the code in C#:

    C#
    Copy Code
    C1GridView1.AutoGenerateColumns = false;
     C1GridView1.ShowFooter = true;
     C1GridView1.Columns[0].FooterText = "Footer";

    What You've Accomplished
    This example sets the footer text for the first column to "Footer".

    Note: The footer text can only be set for columns that are not automatically generated.

    See Also