Binding a BindingManagerBase to a dataview

Posted on 2006-03-30
Last Modified: 2008-02-26


I am using a Dataview to filter rows of data from a table in MSDE.
My controls are placed on a Windows form, contain a datagrid, textboxes and  naviagation buttons (btnNext, btnPrevious..)
I use a BindingManagerBase for navigation.

My problem is this: When I filter the Dataview, the filtered rows are dispalyed in the datagrid, but the textboxes remain unchanged displaying data from the first record in the table, although they are bound to the Dataview. Also the navigation buttons work in the same way before the data was filtered, moving between the first and last record in the table.

What I needed was to show the filtered records in the datagrid and to have the navigation buttons only move between the filtered records.

Question by:tariqanis2001
    LVL 34

    Accepted Solution

    Try this

       Dim FilteredCurrencyManager As CurrencyManager
       FilteredCurrencyManager = Me.BindingContext(<myDataView>)

    and then do your navigation with

       FilteredCurrencyManager.Position += 1

       FilteredCurrencyManager.Position -= 1

    and so on.

    Or, if you prefer, you can simply alter how you declare your current BindingManagerBase from, I assume

       MyBindingManagerBase = Me.BindingContext(<myDataTable>)


       MyBindingManagerBase = Me.BindingContext(<myDataView>)


    Author Comment

    It worked fine. Thanks a million.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Article by: jpaulino
    XML Literals are a great way to handle XML files and the community doesn’t use it as much as it should.  An XML Literal is like a String ( Literal, only instead of starting and ending with w…
    A while ago, I was working on a Windows Forms application and I needed a special label control with reflection (glass) effect to show some titles in a stylish way. I've always enjoyed working with graphics, but it's never too clever to re-invent …
    Hi everyone! This is Experts Exchange customer support.  This quick video will show you how to change your primary email address.  If you have any questions, then please Write a Comment below!
    This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor ( If you're looking for how to monitor bandwidth using netflow or packet s…

    779 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    13 Experts available now in Live!

    Get 1:1 Help Now