BindingNavigator Not Working

I am trying to use the BindingNavigator with XML data in DataGridView.

Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

Dim filePath As String = "authors.xml"
[AuthorsDataSet].ReadXml(filePath)
DataGridView1.DataSource = [AuthorsDataSet]
DataGridView1.DataMember =
"authors"

' Set the DataSource to the DataSet, and the DataMember
' to authors.
BindingSource1.DataSource = [AuthorsDataSet]
BindingSource1.DataMember =
"authors"

BindingNavigator1.BindingSource = BindingSource1

End Sub

The XML data loads into the DataGridView OK. The BindingNavigator shows the correct number of records, however nothing happens in the DataGridView when I click the "Move next", etc icon(s).



Answer this question

BindingNavigator Not Working

  • Morten Dahl

    Hi Robert,

    You should do this instead:

    Dim filePath As String = "authors.xml"
    [AuthorsDataSet].ReadXml(filePath)

    ' Set the DataSource to the DataSet, and the DataMember
    ' to authors.
    BindingSource1.DataSource = [AuthorsDataSet]
    BindingSource1.DataMember =
    "authors"

    DataGridView1.DataSource = BindingSource1
    BindingNavigator1.BindingSource = BindingSource1

    The DataGridView1 and BindingNavigator1 should be bound to the same BindingSource for the BindingNavigator to work.

    Best regards,



  • Rakesh Kumar V.V. from Pampady

    Works like a charm! Thanks Huy
  • BindingNavigator Not Working