I have KbcartBindingSource.Filter = "cart_id='" & TextBox1.Text & "'" this changes my DataGridView to only show the cart with the ID the user typed in. How do I reset the DataGridView to show all of the Carts again?
Rick
Printable View
I have KbcartBindingSource.Filter = "cart_id='" & TextBox1.Text & "'" this changes my DataGridView to only show the cart with the ID the user typed in. How do I reset the DataGridView to show all of the Carts again?
Rick
I figured it out: KbcartBindingSource.Filter = String.Empty
KbcartBindingSource.Filter = String.Empty
dgv1.DataSource = original value
Should work?
(Sorry, I posted the response and you had updated the thread already...)
A simple look at the MSDN documentation for the BindingSource class would have shown you RemoveFilter method. As you can see from the attached screen shot though, only someone with a thorough understanding of VB already could have possibly deciphered it. Then again, maybe anyone who can read English would have. The documentation for the BindingSource.Filter property also specifically states:As I have already said elsewhere, the documentation is for everyone. If you don't read it you only hurt yourself. You found an answer this by yourself, for which I congratulate you, but you obviously still ignored the documentation. Reading the documentation will help make you a better developer. Is that not the aim?Quote:
To stop filtering the DataSource, call the RemoveFilter method.
By the way, I do have more than one string to my bow. I have provided plenty of code and advice over the years, as you may be able to see by my post count and reputation. I would like to see everyone learn as much as possible though, and the way to do that is to read. My advice will help you if you let it. You're the one who'll suffer if you don't. Obviously, it's your choice.
Thank you John