如何提取DataGrid单元格的值
我想把DataGrid选定的单元格的值赋值给一个textbox.text属性,请问如何实现?谢谢!
2006-09-18 21:45
2006-09-19 08:16
2006-09-19 16:13
[此贴子已经被作者于2006-9-19 19:16:33编辑过]

2006-09-19 19:15
2006-09-28 01:08
Private Sub dgApt_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles dgApt.MouseDown
Dim myGrid As DataGrid = CType(sender, DataGrid)
Dim hti As System.Windows.Forms.DataGrid.HitTestInfo
hti = myGrid.HitTest(e.X, e.Y)
If hti.Row = -1 Then Exit Sub
Try
mAptId = CInt(dgApt.Item(hti.Row, 0))
CmbAType.Text = Trim(dgApt.Item(hti.Row, 1))
cmbStation.Text = Trim(dgApt.Item(hti.Row, 2))
Catch ex As Exception
End Try
End Sub
2006-09-28 08:27
应该利用HITTEST的属性
2006-10-17 15:56
谢谢各位, ----------雪中送炭-----------
2006-12-06 15:48