日期:2014-05-17  浏览次数:20987 次

在datagridview中按键盘中的上下箭头事件是什么?
在datagridview中按键盘中的上下箭头事件是什么?

我想按上下箭头,把datagridview的当前行数据显示到textbox。

------解决方案--------------------
Private Sub BindGrid()
Dim strWhre As String = " select top 1000 * from I_CustomOrder order by WRRDTE desc"
Dim conn As New SqlConnection(ConfigurationManager.AppSettings("cnn"))
Dim adt As New SqlDataAdapter(strWhre, conn)
Dim dataset As New DataSet
adt.Fill(dataset, "jobs")

BindingSource1.DataSource = dataset.Tables(0)

DataGridView1.DataSource = BindingSource1
BindingNavigator1.BindingSource = BindingSource1

Me.TextBox1.DataBindings.Add(New Binding("Text", BindingSource1, "wrfac", True))
Me.TextBox2.DataBindings.Add(New Binding("Text", BindingSource1, "wrloc", True))
Me.TextBox3.DataBindings.Add(New Binding("Text", BindingSource1, "wrprod", True))
Me.TextBox4.DataBindings.Add(New Binding("Text", BindingSource1, "wrtool", True))
Me.TextBox5.DataBindings.Add(New Binding("Text", BindingSource1, "wrrdte", True))
Me.TextBox6.DataBindings.Add(New Binding("Text", BindingSource1, "wrqty", True))


Label1.Text = "共" + dataset.Tables(0).DefaultView.Count.ToString() + "條記錄"
'TextBox1.DataBindings.Add(New System.Windows.Forms.Binding("Text", dataset, "jobs.wrtool", True))

End Sub