开发者

Filtering grid view when binded using datasender in asp.net

开发者 https://www.devze.com 2023-03-26 17:53 出处:网络
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 开发者_如

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();
0

精彩评论

暂无评论...
验证码 换一张
取 消