Hi Guys, Firstly, Happy New Year!!
Second, here my first query of the new year:

I am using a stored proceedure to retrieve records from a database that match a number of search parameters. I now want to show a subset of those records in my Datagridview. I don't, however, want to alter the stored proceedure. I cant see any clean way to add the new parameter : /

I decided to affect the subsets by hiding rows in the datagridview. I did this in the RowsAdded event. However, i have noticed something odd. Everything works fine except for one row. I set its .visible property to false but i can still see it : / Also, the RowsAdded event fires twice..the first time it adds the single problem row, the second time it adds the remaining 1940-odd rows.

SO, why is it adding this row seperatelty and why is it showing in the datagridview regardless of its .visible property??

7 Years
Discussion Span
Last Post by Geekitygeek

You can add a rowfilter to the default view of the DataTable :

gridTable.DefaultView.RowFilter = "CompanyName < 'I'";
Votes + Comments
fast response and exactly what i needed. Thanks :)

WOW! Cant believe i've been messing around trying to manually hide the rows *palms forehead*

I applied the filter to the BindingSource and it shows/hides the rows perfectly..Really responsive too. Thanks again sknake :)

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.