[2005] How to remove BindingSource.Filter?-VBForums
Results 1 to 4 of 4

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 03: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
    .NUT jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    88,663

    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.
    Last edited by jmcilhinney; Feb 9th, 2008 at 03:13 AM.

    2007-2014

    Why is my data not saved to my database? | MSDN Data Walkthroughs
    MSDN "How Do I?" Videos: VB | C#
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts) | WP8 Turnstile Feather Transition with Pivot Control
    Beginner Tutorials: VB | C# | SQL

Posting Permissions

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



Featured


Click Here to Expand Forum to Full Width

Survey posted by VBForums.