ComponentOne GridView for ASP.NET WebForms
Task-Based Help / Enable Check Box Filtering
In This Topic
    Enable Check Box Filtering
    In This Topic

    This topic demonstrates how to use filters on a CheckBox column of a C1GridView control. 

    Note: To use CheckBox Filters in the C1GridView control, the table in the database bound to the C1GridView must contain a yes/no (CheckBox) field.

    In the Designer

    Complete the following steps:

    1. Drag and drop a C1GridView control to your Web Form.
    2. Add data to the C1GridView. For more information, see Binding the Grid to a Data Source.
    3. Click the Smart Tag on the top left corner of the C1GridView control to enable filters and select Property Builder from the drop-down menu.
    4. In the Property Builder window, check the ShowFilter option and click OK. A filter bar appears at the top of the grid just under the grid’s column headings.

    In Source View

    To enable filtering on the checkbox field, modify the <cc1:C1GridView ></cc1:C1GridView > tag as shown below:

    <cc1:C1GridView ID="C1GridView1" runat="server" AutogenerateColumns="False" DataKeyNames="ID" 
    
    DataSourceID="SqlDataSource1" ShowFilter="True">
    

    Set the ShowFilter property to True.

    In Code

    To enable checkbox filters, add the following code to the Page_Load event:

    To write the code in Visual Basic:

    Visual Basic
    Copy Code
    ' Set ShowFilter to True
     C1GridView1.ShowFilter = True

    To write the code in C#:

    C#
    Copy Code
    // Set ShowFilter to true
     C1GridView1.ShowFilter = true;
    See Also