View Single Post
  #2 (permalink)  
Old June 18th, 2004, 07:38 AM
jaucourt jaucourt is offline
Friend of Wrox
Join Date: Jul 2003
Location: York, , United Kingdom.
Posts: 142
Thanks: 0
Thanked 2 Times in 2 Posts

In the Datagrid.DoubleClick event, you could use the CurrentCell property, if you wanted the contents of the currently selected cell to be copied into a textbox:

Private Sub DataGrid1_DoubleClick(ByVal sender As Object, ByVal e As System.EventArgs) Handles DataGrid1.DoubleClick
  Dim cell As DataGridCell = DataGrid1.CurrentCell
  Dim text As String = Dataset1.Rows(cell.RowNumber)(cell.ColumnNumber).ToString
  textbox1.text = text
End Sub
This might need a bit of tweaking as I haven't tested it, but should work

Reply With Quote