DefaultView.RowFilter

jswota

Well-known member
Joined
Feb 23, 2009
Messages
49
Programming Experience
Beginner
Hi.

I am having some issues with the DefaultView.RowFilter method. I worked until now and i think i know why. I am trying to use the RowFilter method to filter my view to show only what is selected in my grid. I am assembling an IN list of row ID's such as RowFilter = "[ID] IN (1, 3, 5, etc...). This isn't working and i think it's because ID is not an actual field in the database. I have added an auto-increment column named ID to my ADO.Net DataTable so i can filter my grid selection. I don't really need this ID for anything else and the ID's are just reset starting from one everytime the tableadapter.Fill method is called. Does anyone know how the DefaultView.RowFilter method works? Does is requery the database? Do i actually need an ID column in the database?

Thanks,
Joel
 
RowFilter is evaluated on the local data, that's the whole point of it. Are you displaying this 'id' column? What values do you see without filter and after re-fill? My guess is that the autoincrement keeps on counting each fill.
 
Back
Top