Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
145
Save changes to webgrid
posted

I'm using a 2-level hierarchial webgrid.

The data in both bands are allowed to be edited.

When the user clicks on a Submit button, I want to capture all the rows that were modified and find which cell was modified.

how do I do it? I'm using ADO.NET for the datasource

Parents
No Data
Reply
  • 459
    posted

    i've put this code in the updaterowbatch-event. i use the sqldataadapter, but i think it should work with ado as well..

    Dim row As DataRow

    If e.Row.DataChanged = DataChanged.Added Then

    row = Me.sqlDatasetNetwerk.tblNetwerkDocumentatie.NewtblNetwerkDocumentatieRow

    Else

    row = Me.sqlDatasetNetwerk.tblNetwerkDocumentatie.FindByID(CStr(e.Row.DataKey))

    End If

    For Each cell As UltraGridCell In e.Row.Cells

    If cell.Column.Key <> "ID" Then

    If Not cell.Value Is Nothing Then

    row(cell.Column.Key) = cell.Value

    Else

    row(cell.Column.Key) = DBNull.Value

    End If

    End If

    Next

    If e.Row.DataChanged = DataChanged.Added Then

    Me.sqlDatasetNetwerk.tblNetwerkDocumentatie.Rows.Add(row)

    End If

     

Children
No Data