ComponentOne GridView for ASP.NET WebForms
Task-Based Help / Updating the Grid with AJAX / Filtering Columns
In This Topic
    Filtering Columns
    In This Topic

    You can use AJAX to update the grid when the user filters columns at run time. For example, you can update the grid with AJAX on filtering in the Designer, in Source view, and in code. For more information about filtering columns, see the Filtering topic.

    In the Designer

    To enable AJAX when filtering a column, complete the following steps:

    1. Select the C1GridView control and navigate to the Properties window.
    2. In the Properties window, set the ShowFilter property to True.
    3. If you run the program now, you will notice that the whole page refreshes when you filter a column.
    4. In the project, with the C1GridView control still selected, expand the CallbackSettings node, click the drop-down arrow next to the Action property in the Properties window, and check the Filtering check box.

    In Source View

    Switch to Source view and add ShowFilter="True" and CallbackOptions="Filtering" to the <cc1:C1GridView> tag, so it appears similar to the following:

    <cc1:C1GridView ID="C1GridView1" runat="server" AutoGenerateColumns="False" DataSourceID="AccessDataSource1" VisualStylePath="~/C1WebControls/VisualStyles" ShowFilter="True" CallbackOptions="Filtering">
    
    

    In Code

    To enable AJAX when filtering a column, add the following code to the Page_Load event:

    To write the code in Visual Basic:

    Visual Basic
    Copy Code
    C1GridView1.ShowFilter = True
    C1GridView1.CallbackOptions = CallbackOptions.Filtering

    To write the code in C#:

    C#
    Copy Code
    C1GridView1.ShowFilter = true;
    C1GridView1.CallbackOptions = CallbackOptions.Filtering;

    What You've Accomplished

    Now when you run the program and filter a column, you will notice that only the grid refreshes.

    See Also