Data Row Search From Bulk Data Binded Grid

  1. <script type="text/javascript">  
  2. function Search_Gridview(strKey, strGV)  
  3. {  
  4.     //debugger;  
  5.     //if (document.getElementById('ddlAppFor').value == "0") {  
  6.     //alert("hello");  
  7.     //}  
  8.     var strData = strKey.value.toLowerCase().split(" ");  
  9.     var tblData = document.getElementById(strGV);  
  10.     var rowData;  
  11.     for (var i = 1; i < tblData.rows.length; i++)  
  12.     {  
  13.         rowData = tblData.rows[i].innerHTML;  
  14.         var styleDisplay = 'none';  
  15.         for (var j = 0; j < strData.length; j++)  
  16.         {  
  17.             if (rowData.toLowerCase().indexOf(strData[j]) >= 0) styleDisplay = '';  
  18.             else  
  19.             {  
  20.                 styleDisplay = 'none';  
  21.                 break;  
  22.             }  
  23.         }  
  24.         tblData.rows[i].style.display = styleDisplay;  
  25.     }  
  26. }  
  27. </script>  
On aspx page 
  1. <asp:TextBox ID="txtSearch" runat="server" Font-Size="20px" placeholder="Find Application Data from Details"  
  2. onkeyup="Search_Gridview(this, 'Grid_AppSearch')"></asp:TextBox><br />  

    1. < asp: GridView ID = "Grid_AppSearch"
    2. runat = "server"
    3. Width = "100%"
    4. Style = "border: 0; height: auto;" >
    5. < /asp:GridView>
     
     
On Code Bihind
  1. using System;  
  2. using System.Collections.Generic;  
  3. using System.Linq;  
  4. using System.Web;  
  5. using System.Web.UI;  
  6. using System.Web.UI.WebControls;  
  7. using System.Data;  
  8. using System.Data.SqlClient;  
  9. using System.IO;  
  10. public partial class class_name: System.Web.UI.Page  
  11. {  
  12.     protected void Page_Load(object sender, EventArgs e)  
  13.     {  
  14.         if (!IsPostBack)  
  15.         {  
  16.             Bindyourgrid_in_pageload();  
  17.         }  
  18.     }   
  19. }  
  20.