Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

question about capturing data from grid

Status
Not open for further replies.

purplehaze1

Programmer
Jul 23, 2003
86
0
0
US
I want to save all changes made to the dataset when user edits the datagrid and clicks save button.
But when I try to capture the data from the dataset, I see the data from last row is always missing unless before I click save, I manually goto the next row on the grid and click save.
What do I have to do so that I don't have to goto nextrow each time I save?
Thanks.

Protected dsRequestLines As New DataSet()

If dsRequestLines.HasChanges Then
dsChanges = dsRequestLines.GetChanges
For Each oRequestRow In dsChanges.Tables(LineItem).Rows
oRequestLine = New RequestLine()
With oRequestLine
.Product = oRequestRow.Item("product").ToString()
.Quantity = oRequestRow.Item("quantity").ToString()

.Supplier = oRequestRow.Item("supplier").ToString()

End With
.RequestLines.Add(oRequestLine)
oRequestLine = Nothing
Next
End If
 
Hy,
I'm new in vb.net but maybe this will work for you.
Put in the sub for save button this line:

Me.BindingContext(mydataset,mytable).EndCurrentEdit()

dan
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top