Prev, Next record?

pryspr01

Member
Joined
Jan 5, 2006
Messages
15
Programming Experience
Beginner
i keep getting this error

HTML:
An unhandled exception of type 'System.Exception' occurred in system.windows.forms.dll

Additional information: DataBinding could not find a row in the list that is suitable for all bindings

When I click the back button accessing my data.

VB.NET:
    Private Sub btnprevious_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ntnprevious.Click
        Me.BindingContext(DataSet12, "ProspectTable").Position -= 1
    End Sub

Anyone have any clue as to why? I had it working and then changed the databindings of a seperate dropdown, dont know if its related.
 
The BindingContext of a form will affect EVERY bound control on that form. If you want different controls to be bound to different objects then I'd guess that you would have to use different containers for them, e.g. Panels, GroupBoxes, etc., and then use the BindingContext of each container seperately.
 
this may solve the problem
VB.NET:
Me.BindingContext(DataSet12, "ProspectTable").Position =(Me.BindingContext(DataSet12, "ProspectTable").Position - 1)
 
Back
Top