Private Sub DataGrid1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles DataGrid1.Click
'DataGrid 事件取得字段数据
Me.TextBox1.Text = DataGrid1.Item(DataGrid1.CurrentCell.RowNumber, 0
Me.TextBox2.Text = DataGrid1.Item(DataGrid1.CurrentCell.RowNumber, 2
Me.TextBox3.Text = DataGrid1.Item(DataGrid1.CurrentCell.RowNumber, 3
Me.TextBox4.Text = DataGrid1.Item(DataGrid1.CurrentCell.RowNumber, 4
Me.TextBox5.Text = DataGrid1.Item(DataGrid1.CurrentCell.RowNumber, 6
Me.TextBox6.Text = DataGrid1.Item(DataGrid1.CurrentCell.RowNumber, 7
Me.TextBox7.Text = DataGrid1.Item(DataGrid1.CurrentCell.RowNumber, 8
Me.TextBox8.Text = DataGrid1.Item(DataGrid1.CurrentCell.RowNumber,
Me.Label10.Text = "共" & dt.Rows.Count & "条记录,当前为第" & DataGrid1.CurrentCell.RowNumber + 1 & "条"
End Sub
谢谢各位的帮助,程序在DataGrid 的点击事件里编写的。
结贴!!!
'DataGrid 事件取得字段数据
Me.TextBox1.Text = DataGrid1.Item(DataGrid1.CurrentCell.RowNumber, 0
Me.TextBox2.Text = DataGrid1.Item(DataGrid1.CurrentCell.RowNumber, 2
Me.TextBox3.Text = DataGrid1.Item(DataGrid1.CurrentCell.RowNumber, 3
Me.TextBox4.Text = DataGrid1.Item(DataGrid1.CurrentCell.RowNumber, 4
Me.TextBox5.Text = DataGrid1.Item(DataGrid1.CurrentCell.RowNumber, 6
Me.TextBox6.Text = DataGrid1.Item(DataGrid1.CurrentCell.RowNumber, 7
Me.TextBox7.Text = DataGrid1.Item(DataGrid1.CurrentCell.RowNumber, 8
Me.TextBox8.Text = DataGrid1.Item(DataGrid1.CurrentCell.RowNumber,
Me.Label10.Text = "共" & dt.Rows.Count & "条记录,当前为第" & DataGrid1.CurrentCell.RowNumber + 1 & "条"
End Sub
谢谢各位的帮助,程序在DataGrid 的点击事件里编写的。
结贴!!!