Click here to Skip to main content
15,891,777 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
My dataview does not filter rows. What is the reason it shows column name only? Can anyone suggest me?
C#
private void txtSearch_TextChanged(object sender, EventArgs e)
{
  DataSet ds1 = new DataSet();
  // ds.Clear();
  string[] str = { "inky", "pinky" };
  ds1 = ppt.P_DS("TBL_ITEMS_SEARCH_DELETE", str);
  // dataGridView1.DataSource = ds.Tables[0];
  DataView dv = new DataView(ds1.Tables[0]);
  dv.RowFilter ="ITEMCODE = '"+  txtSearch.Text+"'";
  this. dataGridView1.DataSource = dv;
}


Thanks
Posted
Updated 16-Dec-10 18:48pm
v4
Comments
Abdul Quader Mamun 17-Dec-10 0:35am    
Use pre tag for better reading of your code. And check spelling.
Abdul Quader Mamun 17-Dec-10 0:47am    
Have you checked row filter properly?
Sandeep Mewara 17-Dec-10 1:17am    
Whats the issue? I don't see anything wrong above. As long as the search text is present in the dataset, they will be filtered.

1 solution

You have forgotten to bind the data
this.dataGridView1.DataBind();

at the end as Abdul said.
then it will work.
 
Share this answer
 
v2

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