ASP.NET
i want to filter the rows of gridview using a drop down list .how can it be done.
4 Answers
Know the answer? Post it. Somebody with the same question will find it here.
Know the answer? Post it. Somebody with the same question will find it here.
Kavi sujaRank #9,620 · 203 pointsPosted May 27, 2013, 4:15 AM EDT
ashima kukreja13 pointsPosted May 27, 2013, 4:19 AM EDT
actuly i am making a job portal .so in admin part i want that admin can filter the resumes on basis of qualification ,location (dropdown list).so how can i do this in gridview .and these dropdown lists have the lisitems.
Kavi sujaRank #9,620 · 203 pointsPosted May 27, 2013, 4:39 AM EDT
Try to do this..
String filterValue = drp.SelectedValue;
DataTable dt = Your datatable;
DataView dv = dt.DefaultView;
dv.RowFilter = "product_category = '" + filterValue + "'";
lstView.DataSource = dv; lstView.DataBind();
also refer this link
http://www.codeproject.com/Articles/14036/Filter-Items-in-the-Dropdown-control-after-DataBin
This may be help you
http://forums.asp.net/t/1857040.aspx/1?DropdownList+and+setting+a+wildcard+value+to+display+all+values
Kavi sujaRank #9,620 · 203 pointsPosted May 27, 2013, 4:57 AM EDT
Got an idea?Also check this....
http://www.nullskull.com/a/799/aspnet-gridview-filtering-with-dropdownlist.aspx