<script type="text/javascript"> function Search_Gridview(strKey, strGV) { var strData = strKey.value.toLowerCase().split(" "); var tblData = document.getElementById(strGV); var rowData; for (var i = 1; i < tblData.rows.length; i++) { rowData = tblData.rows[i].innerHTML; var styleDisplay = 'none'; for (var j = 0; j < strData.length; j++) { if (rowData.toLowerCase().indexOf(strData[j]) >= 0) styleDisplay = ''; else { styleDisplay = 'none'; break; } } tblData.rows[i].style.display = styleDisplay; } } </script>
<div style="border: 1px solid Black; width: 800px; padding: 20px; height: 350px; font-size: 20px;"> Search : <asp:TextBox ID="txtSearch" runat="server" Font-Size="20px" onkeyup="Search_Gridview(this, 'gvTest')"></asp:TextBox><br /> <br /> <asp:GridView ID="gvTest" runat="server" OnPageIndexChanging="GrdRole_PageIndexChanging" PageSize="10000"> <columns> <asp:TemplateField> <ItemTemplate> <asp:CheckBox ID="chkSelect" runat="server" /> </ItemTemplate> </asp:TemplateField> </columns> </asp:GridView> </div>
null
rows
tblData
var tblData = document.getElementById(strGV);
Client ID
function Search_Gridview(strKey) { var strGV = '<%= gvTest.ClientID %>';
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)