Answer to Question #21465 in C# for Tabish

Question #21465
I made a program in C#, I am retrieving data from a text file in datagridview.
I made a textbox, i want to do whenever user types into a textbox, the datagridview filter and shortlist the matching data automatically.how can i do that? I am new to c#, Please send me the code.
thanks in advance.
1
Expert's answer
2013-01-29T07:51:58-0500

//This is example of code filtered by column "Name"
private void buttonFilterClick(sender object, EventArgs e)
{
DataSet ds = new DataSet();
ds.ReadXML(fileName);
DataView dv = new DataView (ds.Tables[0]); //ds.Tables["name"]
grid.DataSource = dv;
dv.RowFilter = string.Format(" Name& like '{0}' ", textBox1.Text);
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
APPROVED BY CLIENTS