This is a migrated thread and some comments may be shown as answers.

[Solved] filtering the data in the grid

3 Answers 87 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Jols
Top achievements
Rank 2
Jols asked on 16 May 2009, 05:57 AM
hello to all expert

                          Good Day ! i would like to ask some again to all of you who knows very will, here's my question in my page i have two textbox namely idnumber and firstname, one button namely search and one grid. i'm using stored procedure to load the data on the grid..now when the user input an idnumber or firstname and click the button search it will filter..is there a way to filter the data inside the grid without having any stored proc.on my search button to filter the data..

sample codes is highly appreciated

thanks to all

3 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 18 May 2009, 08:02 AM
Hi Jols,

You may try setting the FilterExpression for the Grid in the click event of the Search button as shown below.

CS:
 
 protected void Button1_Click(object sender, EventArgs e) 
    { 
        RadGrid1.MasterTableView.FilterExpression = "([ProductName] LIKE '"+TextBox1.Text +"')"
        RadGrid1.MasterTableView.Rebind(); 
    } 


Thanks
Princy.
0
Jols
Top achievements
Rank 2
answered on 18 May 2009, 08:16 AM
Sir.. there is no need to configure my Radgrid_needdatasource ? or i straigthly just call the rebind() as you showned the above codes of yours?
0
Princy
Top achievements
Rank 2
answered on 18 May 2009, 08:39 AM
Hi Jols,

Rebind() will automatically call the NeedDataSource event. You just need to replace the ProductName with the UniqueName of your Grid column.

Princy.
Tags
Grid
Asked by
Jols
Top achievements
Rank 2
Answers by
Princy
Top achievements
Rank 2
Jols
Top achievements
Rank 2
Share this question
or