Click here to Skip to main content
15,891,184 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have a problem that I have GtridView in that Total Field now i have a textbox Above Grid
now I want to search total value as I Enter 3 then it show all data in grid starting with 3
then it show value oF Total Like


3400
3425
3700
3875

then i entered 4 after entering 3 like-->34

then it show
3400
3425

that i want to textbox keyUp event Please help me For that

i tried
My code is

DataTable dt1 = Bank.GetBanks("","","","").Tables[0];
DataView d = new DataView(dt1);
d.RowFilter = "(Convert,Code) Like '%" + txtBank.Text + "%'";
d.RowStateFilter = DataViewRowState.CurrentRows;
BankGridView.DataSource = d;
BankGridView.DataBind();
txtBank.Focus();

bt it cannot search it.
Posted

1 solution

Hi,
Use TextChanged event of Textbox-
ex.
C#
private void textBox1_TextChanged(object sender, EventArgs e)
{

    bs.Filter = string.Format("field1 LIKE '%{0}%'", textBox1.Text);

}
 
Share this answer
 
Comments
hardy panchal 16-Feb-13 2:12am    
but i Want it on Key Up Event

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



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