Click here to Skip to main content
15,897,360 members
Please Sign up or sign in to vote.
3.00/5 (1 vote)
See more:
I have a code of button next :


Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim conn As New SqlConnection("data source=localhost;initial catalog=thinghiem;user=sa;pwd=sa")
        conn.Open()
        Dim dt As New DataTable
        Dim da As New SqlDataAdapter("select*from SINHVIEN", conn)
        da.Fill(dt)
        DataGridView1.DataSource = dt
        Me.BindingContext.Item(dt).Position = Me.BindingContext.Item(dt).Position + 1
    End Sub


why when I press the next button that DataGridView just scroll down the second line
Posted
Updated 12-Nov-10 17:25pm
v4

1 solution

Remove "+1" in last line if you want a pointer to be on the first line
Me.BindingContext.Item(dt).Position = Me.BindingContext.Item(dt).Position
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900