TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
C# Corner
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Data Row Search From Bulk Data Binded Grid
Shivam Tiwari
Jan 30
2016
Code
906
0
0
facebook
twitter
linkedIn
Reddit
WhatsApp
Email
Bookmark
expand
<script type=
"text/javascript"
>
function Search_Gridview(strKey, strGV)
{
//debugger;
//if (document.getElementById('ddlAppFor').value == "0") {
//alert("hello");
//}
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>
On aspx page
<asp:TextBox ID=
"txtSearch"
runat=
"server"
Font-Size=
"20px"
placeholder=
"Find Application Data from Details"
onkeyup=
"Search_Gridview(this, 'Grid_AppSearch')"
></asp:TextBox><br />
< asp: GridView ID = "Grid_AppSearch"
runat = "server"
Width = "100%"
Style = "border: 0; height: auto;" >
< /asp:GridView>
On Code Bihind
using
System;
using
System.Collections.Generic;
using
System.Linq;
using
System.Web;
using
System.Web.UI;
using
System.Web.UI.WebControls;
using
System.Data;
using
System.Data.SqlClient;
using
System.IO;
public
partial
class
class_name: System.Web.UI.Page
{
protected
void
Page_Load(
object
sender, EventArgs e)
{
if
(!IsPostBack)
{
Bindyourgrid_in_pageload();
}
}
}
datarow
Gridview
search in Gridview
bulk data search