purplehaze1
Programmer
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
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