Results 1 to 5 of 5

Thread: [2005] How to remove BindingSource.Filter?

  1. #1

    Thread Starter
    Member
    Join Date
    Sep 2007
    Posts
    35

    Resolved [2005] How to remove BindingSource.Filter?

    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
    Last edited by mousewonders; Jan 4th, 2008 at 04:17 PM.

  2. #2

    Thread Starter
    Member
    Join Date
    Sep 2007
    Posts
    35

    Re: [2005] How to remove BindingSource.Filter?

    I figured it out: KbcartBindingSource.Filter = String.Empty

  3. #3
    Hyperactive Member
    Join Date
    Feb 2006
    Location
    UK
    Posts
    285

    Re: [2005] How to remove BindingSource.Filter?

    KbcartBindingSource.Filter = String.Empty
    dgv1.DataSource = original value

    Should work?


    (Sorry, I posted the response and you had updated the thread already...)

  4. #4
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    110,297

    Re: [2005] How to remove BindingSource.Filter?

    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:
    To stop filtering the DataSource, call the RemoveFilter method.
    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?

    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.

  5. #5
    Frenzied Member
    Join Date
    Apr 2016
    Posts
    1,415

    Re: [2005] How to remove BindingSource.Filter?

    Thank you John

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width