This example shows how jqGrid deals with paging, sorting and filtering with 1,000,000 rows of data. This is supported purely by Linq / LinqDataSource and does not require a single line of code!

We are using just a couple of lines of C# code in the special case when "All" is selected to cancel filtering (show all records). Check the C# tab for details, and the ASPX tab for complete setup.

jqGrid for ASP.NET supports search toolbar mode, where you can have a search toolbar on top of each column of the grid. To show the search toolbar, set the ToolBarSetting.ShowSearchToolBar property to true. You can exclude certain columns from appearing in the search options by setting the Searchable property of the respective column to false. Another property that plays role in searching is the SearchToolBarOperation property of each column, to specify how the grid treats searching. Default is Contains.
When a column is searchable, you can select how end-users will search it. This is controlled by the Column.SearchType property and current has four different options - TextBox, DropDown, AutoComplete and DatePicker
In addition to that, you can specify the values end-users will see in value:name pairs in the EditValues property of Columns - this is especially useful for EditType.DropDown. Here is an example

<trirand:JQGridColumn DataField="CompanyName" Searchable="true" SearchType="DropDown" SearchValues="1:FedEx;2:UPS;3:TNT" />

When searching is performed the grid triggers Searching / Searched event which you can use to customize this behaviour.
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="default.aspx.cs" Inherits="JQSuiteASPNETExample.examples.loading_data.million_linqdatasource._default" %>
<%@ Register Assembly="Trirand.Web" TagPrefix="trirand" Namespace="Trirand.Web.UI.WebControls" %>

<!DOCTYPE html>
<html lang="en-us">
<head id="Head1" runat="server">
    <meta charset="utf-8">
    <title>jqGrid for ASP.NET WebForms - million rows of data</title>
    <!-- The jQuery UI theme that will be used by the grid -->
    <link rel="stylesheet" type="text/css" media="screen" href="http://code.jquery.com/ui/1.12.1/themes/redmond/jquery-ui.css" />
    <!-- The jQuery UI theme extension jqGrid needs -->
    <link rel="stylesheet" type="text/css" media="screen" href="/themes/ui.jqgrid.css" />
    <!-- The jQuery UI theme extension jqAutoComplete -->
    <link rel="stylesheet" type="text/css" media="screen" href="/themes/ui.jqautocomplete.css" />
    <!-- jQuery runtime minified -->
    <script src="/js/jquery-3.2.1.min.js" type="text/javascript"></script>
    <!-- The localization file we need, English in this case -->
    <script src="/js/trirand/i18n/grid.locale-en.js" type="text/javascript"></script>
    <!-- The jqGrid client-side javascript -->
    <script src="/js/trirand/jquery.jqGrid.min.js" type="text/javascript"></script>    
    <!-- The javascript for the grid search/edit advanced controls - datepicker and autocomplete -->
    <script src="/js/trirand/jquery.jqDatePicker.min.js" type="text/javascript"></script>
    <!-- The javascript for the autocomplete control -->
    <script src="/js/trirand/jquery.jqAutoComplete.min.js" type="text/javascript"></script>
    
    <style type="text/css">
        body, html { font-size: 80%; }            
        .ui-autocomplete-loading { background: white url('loading.gif') right center no-repeat; }        
    </style>
</head>
<body>
    <form id="form1" runat="server">       
  
    <trirand:JQGrid runat="server" ID="JQGrid1" DataSourceID="LinqDataSource1" 
            Width="600px" Height="260px" onsearching="JQGrid1_Searching" >
        <Columns>
            <trirand:JQGridColumn 
                DataField="OrderID" 
                Searchable="true"
                SearchToolBarOperation="IsEqualTo"
                DataType="Int"
                HeaderText="Order ID" 
                PrimaryKey="True" 
                Width="50" />
            <trirand:JQGridColumn
                DataField="CustomerID" 
                DataType="String"
                SearchType="DropDown" 
                SearchControlID="DropDownList1"
                SearchToolBarOperation="IsEqualTo" 
                ShowColumnMenu="true"
                />
            <trirand:JQGridColumn 
                DataField="OrderDate" 
                Searchable="true" 
                SearchType="DatePicker"
                SearchControlID="DatePicker1"              
                SearchToolBarOperation="IsEqualTo"
                DataType="DateTime"
                ShowToolTip="false"
                ShowColumnMenu="true"
                DataFormatString="{0:MMM/d/yyyy}"/>
             <trirand:JQGridColumn 
                DataField="Freight"  
                SearchType="DropDown"
                DataType="Decimal"
                ShowColumnMenu="true"
                SearchValues="[All]:[All];10:> 10;20:> 20;30:> 30;50:> 50" 
                SearchToolBarOperation="IsGreaterThan" />    
            <trirand:JQGridColumn 
                Searchable="true"
                DataType="String"
                SearchType="AutoComplete"
                SearchControlID="AutoComplete1"
                SearchToolBarOperation="Contains"
                DataField="ShipName" 
                Width="200" />                      
        </Columns> 
        <ToolBarSettings ShowSearchToolBar="true"/>                                        
    </trirand:JQGrid>
    
    <%-- This control will be used as a DatePicker search UI control in the grid toolbar--%>
    <%-- You can use JQDatePicker as a standalone control outside of a grid by setting DisplayMode="Standalone" --%>
    <trirand:JQDatePicker 
        DisplayMode="ControlEditor"
        runat="server" 
        ID="DatePicker1" 
        DateFormat="M/d/yyyy"
        MinDate="2010-01-01" 
        MaxDate="2020-01-01" 
        ShowOn="Focus" />  
        
    <%-- This control will be used as an AutoComplete search UI control in the grid toolbar--%>
    <%-- You can use JQAutoComplete as a standalone control outside of a grid by setting DisplayMode="Standalone" --%>
    <trirand:JQAutoComplete
        DisplayMode="ControlEditor"    
        DataTextField="ShipName"
        DataValueField="ShipName"
        DropDownWidth="200"
        Height="200"
        LoadingImageUrl="loading.gif"
        Filter="StartsWith"
        DataSourceID="SqlDataSource1"
        runat="server"
        ID="AutoComplete1"
    />
    
    <%--This control will be used as a DropDown search UI control in the grid toolbar--%>
    <asp:DropDownList 
        runat="server" 
        ID="DropDownList1" 
        DataSourceID="SqlDataSource2"
        DataTextField="CustomerID"
        DataValueField="CustomerID"
        AppendDataBoundItems="true">
        <asp:ListItem Text="[All]" Value="[All]"></asp:ListItem>
    </asp:DropDownList>
    
    <asp:LinqDataSource ID="LinqDataSource1" runat="server" 
        AutoPage="true" AutoSort="true"
        ContextTypeName="JQSuiteASPNETExample.dbml.NorthWindDataClassesDataContext" 
        Select="new (OrderID, OrderDate, ShipName, CustomerID, Freight)"         
        TableName="OrdersLarges">
    </asp:LinqDataSource>
    
    <asp:SqlDataSource runat="server" ID="SqlDataSource1" 
        ConnectionString="<%$ ConnectionStrings:SQL2008_661086_trirandEntities %>"        
        SelectCommand="SELECT DISTINCT [ShipName] FROM [Orders]">
    </asp:SqlDataSource>        
    
     <asp:SqlDataSource runat="server" ID="SqlDataSource2" 
        ConnectionString="<%$ ConnectionStrings:SQL2008_661086_trirandEntities %>"                 
        SelectCommand="SELECT DISTINCT [CustomerID] FROM [Orders]">
    </asp:SqlDataSource> 
    
    <br />
    <br />
    <trirand:codetabs runat="server" id="tabs"></trirand:codetabs>
    
    </form>
</body>
</html>
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace JQSuiteASPNETExample.examples.loading_data.million_linqdatasource
{
    public partial class _default : System.Web.UI.Page
    {
        protected void JQGrid1_Searching(object sender, Trirand.Web.UI.WebControls.JQGridSearchEventArgs e)
        {
            if (e.SearchString == "[All]")
                e.Cancel = true;
        }
    }
}
Switch theme:


Theming is based on the very popular jQuery ThemeRoller standard. This is the same theming mechanism used by jQuery UI and is now a de-facto standard for jQuery based components. The benefits of using ThemeRoller are huge. We can offer a big set of ready to use themes created by professional designers, including Windows-like themes (Redmond), Apple-like theme (Cupertino), etc. In addition to that any jQuery UI controls on the same page will pick the same theme.

Last, but not least, you can always roll your own ThemeRoller theme, using the superb Theme Editor

To use a theme, simply reference 2 Css files in your Html <head> section - the ThemeRoller theme you wish to use, and the jqGrid own ThemeRoller Css file. For example (Redmond theme):

<link rel="stylesheet" type="text/css" media="screen" href="/themes/redmond/jquery-ui-1.8.2.custom.css" />
<link rel="stylesheet" type="text/css" media="screen" href="/themes/ui.jqgrid.css" />