i have a gridview to which values are loaded by stored procedure. the grid view is binded to the data source in the aspx.cs file. Now i need to place a filter option for the grid view in aspx 开发者_如何学运维page based on the fields in the grid view.
any one please help me out, thanks in advance
You can use DataView and filter the GridView data:
//filter Gridview ---- doesn't filter
DataView dv = new DataView();
dv.RowFilter = "ColumnName = '" + txt.Text.ToString() + "'";
GridViewID.DataSource = dv;
GridViewID.DataBind();
精彩评论