how to add a pane that allows me to navigate thorugh records on a datagrid view

Posted on 2007-08-08
Last Modified: 2013-11-05
how can i achieve this:,VS.80).gif
i need to add that pane that will allow me to navigate through the records returned on a datagridview how can i do this?
oh with only one minor change instead of showing on the top i need it to diaply on the top thats all
Question by:jsctechy
    LVL 96

    Expert Comment

    by:Bob Learned
    Are you looking for something like a BindingNavigator?

    LVL 1

    Author Comment

    yes that it is exactly what i'm looking for but i dont know how to bing it with my datagridview since i did not use the wizards to do this.
    can you show me how to do this?
    LVL 96

    Accepted Solution

    1) Add a BindingSource to the form
    2) Add a BindingNavigator to the form
    3) Select the BindingSource on the navigator from the BindingSource property
    4) Set the data source for the BindingSource to be the same one as the DataGridView:

      BindingSource1.DataSource = DataSet1.Tables(0)
    5) Set the data source for the DataGridView to the BindingSource.

    LVL 1

    Author Comment

    ok i have added done step 1 - 3 but on 4 i'm not sure since i set up the datasource through code like this:

            ad = New SqlClient.SqlDataAdapter(queryString, connectionString)

            Dim commandBuilder As New SqlClient.SqlCommandBuilder(ad)
            Dim table As DataTable = New DataTable()

            bindingSource = New BindingSource()
            Me.bindingSource.DataSource = table

            Me.dgvAdds.DataSource = Me.bindingSource
            Me.dgvAdds.Columns.Item(0).Visible = False

    how can i also do this for the binding source and the binding navigator?
    LVL 6

    Expert Comment

    LVL 1

    Author Comment

    that is a nice link but it does not show me what i want

    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

    Join & Write a Comment

    Suggested Solutions

    Well, all of us have seen the multiple EXCEL.EXE's in task manager that won't die even if you call the .close, .dispose methods. Try this method to kill any excels in memory. You can copy the kill function to create a check function and replace the …
    1.0 - Introduction Converting Visual Basic 6.0 (VB6) to Visual Basic 2008+ (VB.NET). If ever there was a subject full of murkiness and bad decisions, it is this one!   The first problem seems to be that people considering this task of converting…
    In this sixth video of the Xpdf series, we discuss and demonstrate the PDFtoPNG utility, which converts a multi-page PDF file to separate color, grayscale, or monochrome PNG files, creating one PNG file for each page in the PDF. It does this via a c…
    In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

    728 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

    22 Experts available now in Live!

    Get 1:1 Help Now