Telerik Rad Grid, Searching with Javascript & JQuery

Introduction

 
Here is an interesting topic of searching for grid content just from Java script, not from the code behind. Let me explain.
 
Filter in RAD Grid
 
Here is an example to explain all the searching in Rad Grid.
  1. <script type="text/javascript">  
  2. function buttonClicked(button, UniqueName) {  
  3.      button.parentElement.firstElementChild.value = "";  
  4.      var masterTable = $find("<%=rgProviderRequests.ClientID %>").get_masterTableView();  
  5.      masterTable.filter(UniqueName, button.parentElement.firstElementChild.value, "Contains");  
  6. }  
  7.   
  8. function keyPressed(txtBox, eventArgs, UniqueName) {  
  9.   
  10.   
  11.      var masterTable = $find("<%=rgProviderRequests.ClientID %>").get_masterTableView();  
  12.      masterTable.filter(UniqueName, txtBox.value, "Contains");  
  13. }  
  14. </script> 
Gird
  1. <telerik:RadGrid ID="rgProviderRequests" GridLines="None" runat="server" Width="800px" Skin="Windows7" AutoGenerateColumns="False" OnItemDataBound="rgProviderRequests_ItemDataBound" OnNeedDataSource="rgProviderRequests_NeedDataSource" AllowPaging="True" PageSize="10" AllowFilteringByColumn="true">  
  2.      <ClientSettings>  
  3.           <Resizing AllowColumnResize="false" AllowRowResize="false" ResizeGridOnColumnResize="false" ClipCellContentOnResize="true" EnableRealTimeResize="true" />  
  4.      </ClientSettings>  
  5.      <GroupingSettings CaseSensitive="false" />  
  6.      <FilterMenu EnableImageSprites="false">  
  7.      </FilterMenu>  
  8.      <MasterTableView EditMode="EditForms" DataKeyNames="Status,UserId" NoMasterRecordsText="No records to display" TableLayout="Fixed" AllowFilteringByColumn="true">  
  9.           <PagerStyle Mode="NextPrevAndNumeric" />  
  10.           <Columns>  
  11.                <telerik:GridBoundColumn HeaderText="Date" ItemStyle-Width="90px" SortExpression="CreateDate" HeaderButtonType="TextButton" DataField="CreateDate" UniqueName="CreateDate" HeaderStyle-Width="90px" AllowFiltering="false">  
  12.                </telerik:GridBoundColumn>  
  13.                <telerik:GridBoundColumn HeaderText="User" SortExpression="EmailAddress" HeaderButtonType="TextButton" DataField="EmailAddress" UniqueName="EmailAddress" HeaderStyle-Width="150px" ShowFilterIcon="false" FilterControlWidth="120px" CurrentFilterFunction="Contains" FilterControlToolTip="" FilterImageToolTip="" FilterControlAltText="" AutoPostBackOnFilter="true">  
  14.                     <FilterTemplate>  
  15.                          <asp:TextBox ID="TextBox1" runat="server" onchange="keyPressed(this,event,'EmailAddress');" Height="25px" CssClass="inputLimit" Width="100%"></asp:TextBox>  
  16.                          <asp:ImageButton ID="ImageButton1" runat="server" ImageUrl="~/Images/clearIcon.png" OnClientClick="buttonClicked(this,'EmailAddress');return false;"></asp:ImageButton>  
  17.                     </FilterTemplate>  
  18.                </telerik:GridBoundColumn>  
  19.                <telerik:GridBoundColumn HeaderText="Status" SortExpression="Status" HeaderButtonType="TextButton" DataField="Status" UniqueName="Status" HeaderStyle-Width="100px" ShowFilterIcon="false" FilterControlWidth="70px" CurrentFilterFunction="Contains" FilterControlToolTip="" FilterImageToolTip="" FilterControlAltText="" AutoPostBackOnFilter="true">  
  20.                     <FilterTemplate>  
  21.                          <asp:TextBox ID="TextBox2" runat="server" onchange="keyPressed(this,event,'Status');" Height="25px" CssClass="inputLimit" Width="100%"></asp:TextBox>  
  22.                          <asp:ImageButton ID="ImageButton2" runat="server" ImageUrl="~/Images/clearIcon.png" OnClientClick="buttonClicked(this,'Status');return false;"></asp:ImageButton>  
  23.                     </FilterTemplate>  
  24.                </telerik:GridBoundColumn>  
  25.                <telerik:GridTemplateColumn HeaderText="Select Action" ItemStyle-Width="150px" HeaderStyle-Width="150px" UniqueName="Action" AllowFiltering="false">  
  26.                     <ItemTemplate>  
  27.                          <telerik:RadComboBox ID="rcbAction" Width="160px" DropDownWidth="110px" runat="server" AutoPostBack="true" OnSelectedIndexChanged="OnSelectedIndexChangedHandler">  
  28.                               <Items>  
  29.                                    <telerik:RadComboBoxItem runat="server" Text="Select Action" />  
  30.                               </Items>  
  31.                          </telerik:RadComboBox>  
  32.                          <telerik:RadWindowManager ID="RadWindowManager1" runat="server">  
  33.                          </telerik:RadWindowManager>  
  34.                     </ItemTemplate>  
  35.                </telerik:GridTemplateColumn>  
  36.           </Columns>  
  37.      </MasterTableView>  
  38. </telerik:RadGrid> 
Here is an interesting topic of searching for grid content just from Java script, not from the code behind. Let me explain.