Hello Young
Here is some code that does exactly that:
Private Sub DataGrid1_DoubleClick(ByVal sender As Object, ByVal e As
System.EventArgs) Handles DataGrid1.DoubleClick
Dim MyGrid As DataGrid = DirectCast(sender, DataGrid)
Dim MyEdit As New UpdateAccountTypes(MyDataSet,
MyGrid.CurrentCell.RowNumber)
MyEdit.ShowDialog()
Me.DataGrid1.Refresh()
End Sub
This passes a dataset, and a row number based on the grid's
CurrentCellRowNumber
The Edit form's constructer (Sub New()) takes these two values as an
argument. Just write the code inthe form to handle your editing chores. Any
edit changes you make in the edit form will be reflected in the grid itself.
To make the changes persist, you'll have to update using the dataadapter for
that dataset.
Ibrahim
"Young J. Putt" <j.****@verizon.net> wrote in message
news:0L***************@nwrdny03.gnilink.net...
I have a vb.net datagrid bound to a dataview on a windows form. I want to
use the datagrid to display and filter a list of items, but since the data
is complex, I don't want the user to edit the item using the datagrid.
I'd like to have another form display when the user double clicks the desired
row in the datagrid, and have that form display details for the selected
datagrid row.
I'm having problems figuring out the best way to pass the selected row on
the first form to the second form. All of the data (including data from
related tables,) is already populated in the underlying dataset on the
first form, so I'd like to pass the dataset also. Can anyone recommend the best
and/or easiest way to accomplish this?
Thanks!