In your declarations add:
Private bmb As BindingManagerBase
Then in the section where you make your connection: (or in Form Load if you are not making your connection in code)
bmb = Me.BindingContext(Me.DataGrid1.DataSource, Me.DataGrid1.DataMember)
To step forward thru the records:
Private Sub btnNext_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnNext.Click
If bmb.Position < bmb.Count - 1 Then
bmb.Position = bmb.Position + 1
' add code here to change the display......such as textboxes etc. that you might have bound to the datagrid fields.
End If
End Sub
To move backwards:
Private Sub btnPrevious_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnPrevious.Click
If bmb.Position > 0 Then
bmb.Position = bmb.Position - 1
End If
' add code here to change the display......such as textboxes etc. that you might have bound to the datagrid fields.
End Sub
This should give you and idea on how it works.
Good luck.
james
"john andrew" <jo********@discussions.microsoft.com> wrote in message news:BC**********************************@microsof t.com...
"Ken Tucker [MVP]" wrote:
Hi,
TextBox1.DataBindings.Add("Text", DataSet11.Tables(0), "Country")
Ken
------------------------
"john andrew" <jo********@discussions.microsoft.com> wrote in message
news:A0**********************************@microsof t.com...
I have got a datagrid working, can I assign a datafield from a datasource to
a textbox like in VB6?
Thanks i will try it out,
How do I move next recprd for example? I n VB6 you have a recordset.( Where
can i find this information instead of asking so many questions)