View Single Post
  #5 (permalink)  
Old June 18th, 2004, 08:02 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
Default

I presume you're using a dataset to populate your datagrid? You have to refer to your dataset where I've put Dataset1

If you are using a dataset, you do the following (you also need to know what table you're displaying in the datagrid; the name of this table goes in instead of {MyTable}):

Dim cell As DataGridCell = DataGrid1.CurrentCell
Dim ds As Dataset = Datagrid1.DataSource

' get a handle on the row just clicked on...
Dim dr As Datarow = ds.Tables("{MyTable}").Rows(cell.RowNumber)

' populate text boxes...
textbox1.text = dr(0)
textbox2.text = dr(1)
textbox3.text = dr(2) ' and so ad nauseum...

As before, all this goes in your double click event handler

Reply With Quote