Need Help setting the BindingNavigator Position

Troy

Well-known member
Joined
Feb 7, 2005
Messages
153
Programming Experience
10+
Hey all, I'm having trouble figuring out how to set the position of the Binding Navigator.

I'm Displaying a child form and when I hit the edit button I've setup I want my next form, which contains a BindingNavigator bar, to be set to the correct file location of my databas so all of my bound fields will display the proper information for editing.

I thought it might use something like FindBy but I'm not sure if it would work and how to use it properly to do this.

Here is some code I started.

VB.NET:
       'TODO: This line of code loads data into the 'MHManager.Service' table. You can move, or remove it, as needed.
        Me.ServiceTableAdapter.Fill(Me.MHManager.Service)
        'TODO: This line of code loads data into the 'MHManager.Contact' table. You can move, or remove it, as needed.
        Me.ContactTableAdapter.Fill(Me.MHManager.Contact)
        'TODO: This line of code loads data into the 'MHManager.Package' table. You can move, or remove it, as needed.
        Me.PackageTableAdapter.Fill(Me.MHManager.Package)

        'locate Active MDI Record and Set the input box Counter to it.
        MHManager.Contact.FindByContactID(Val(frmMain.ActiveMdiChild.Tag))

I'm storing the ContactID of my Record in the Tag property of the childform so I can reference it when the form is created. A treeview control containing the Names of the Contacts when selected create the child Form that displays the Contact information.

I need for once the edit Contact button is pressed to have an edit window popup containing all the bound Inputboxes.

THIS I HAVE.

But they aren't containg any info since evidentally the Binding Navigator isn't positioned to the Record information.

I've done this through OLEDB but that was before I was Binding controls. Now I'm using ADO. Seems there should be an easy way to reposition the Binding Navigator to the appropriate file since I have the ContactID information and should be able to Compare that with whats stored in the Database.

In the old days I could just stored the record# and reference that easy.

:confused:
 
Last edited:
VB.NET:
		Dim pos As Integer = Me.BindingSource1.Find("FieldName", TextBox1.Text)

		If Not position = -1 Then
			Me.BindingSource1.Position = pos
		End If

Should be able to modify this easily to pass in the value from the treeview.
 
Back
Top