Click here to Skip to main content
15,891,431 members
Please Sign up or sign in to vote.
1.50/5 (2 votes)
See more:
How to search gridview records\data with textbox using javascript in asp.net
Posted
Comments
Ashi0891 22-Aug-14 1:34am    
your title is different than your question. Please use Improve question option to explain your question as per your title.
Member 10928697 22-Aug-14 3:35am    
Can I Use In The Below Link To My From.......But Gridview Delete & Edit Last Row Does Not Work Plz Slow Them.
--------------------------------------------------------------------------------------------
Insert Update Edit Delete record in GridView using Javascript in ASP.Net
Ashi0891 22-Aug-14 3:42am    
What is the role of "TextBox" in "Insert Update Edit Delete record in GridView using Javascript in ASP.Net" part?
and in case you are looking for two solutions, one for searching gridview data using textbox and other for undergoing sql operations on gridview using javascript then please be more specific. Also tell what have you tried till now.
I have also posted a solution1 please check it out.
Sergey Alexandrovich Kryukov 22-Aug-14 1:35am    
If you search something with Javascript, ASP.NET is totally irrelevant. The question is about HTML and Javascript. The problem is simple enough. What have you tried so far?
—SA
Member 10928697 22-Aug-14 4:58am    
i can search the data using textbox it is worked....but in gridview i can save the data, after that in gridview last row was not updated ,not deleted... onlt update delete options..
can i use below code sir.
-------------------------------------------------------------------------------------------
javascript
-----------
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
<script type="text/javascript" src="js/quicksearch.js"></script>
<script type="text/javascript">
$(function () {
$('.search_textbox').each(function (i) {
$(this).quicksearch("[id*=gvProjects] tr:not(:has(th))", {
'testQuery': function (query, txt, row) {
return $(row).children(":eq(" + i + ")").text().toLowerCase().indexOf(query[0].toLowerCase()) != -1;
}
});
});
});
</script>"
------------------------------------------------------------------------------------
protected void gvProjects_DataBound(object sender, EventArgs e)
{
GridViewRow row = new GridViewRow(0, 0, DataControlRowType.Header, DataControlRowState.Normal);
for (int i = 0; i < gvProjects.Columns.Count-2; i++)
{
TableHeaderCell cell = new TableHeaderCell();
TextBox txtSearch = new TextBox();
txtSearch.Attributes["placeholder"] = gvProjects.Columns[i].HeaderText;
txtSearch.CssClass = "search_textbox";
cell.Controls.Add(txtSearch);
row.Controls.Add(cell);
}
gvProjects.HeaderRow.Parent.Controls.AddAt(1, row);
}

1 solution

Please check this link search-gridview-recordsdata-textbox-using-javascript-asp-net/[^] as your Question.
or you better try checking below link in any case.
How+to+search+gridview+records%5Cdata+with+textbox+using+javascript[^]

I'm sure these Links will be helpful to you.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900