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
215
paste from Excel into WebGrid does not fire the DataChanged.Modified or DataChanged.Added flags on page-postback..
posted

when I paste from Excel into the WebGrid, whether I am replacing an existing row or adding a new row, the grid does not know a change was made to it on page post-back...

I'm firing these events via the grid:
Protected Sub PerformanceGrid_UpdateGrid(ByVal sender As Object, ByVal e As Infragistics.WebUI.UltraWebGrid.UpdateEventArgs) Handles PerformanceGrid.UpdateGrid
Protected Sub PerformanceGrid_AddRowBatch(ByVal sender As Object, ByVal e As Infragistics.WebUI.UltraWebGrid.RowEventArgs) Handles PerformanceGrid.AddRowBatch
Protected Sub PerformanceGrid_UpdateRowBatch(ByVal sender As Object, ByVal e As Infragistics.WebUI.UltraWebGrid.RowEventArgs) Handles PerformanceGrid.UpdateRowBatch

none of these are being fired

I'm also checking for any changes this way on page postback:
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
For Each GridRow As UltraGridRow In PerformanceGrid.Rows
If GridRow.DataChanged = DataChanged.Modified Or GridRow.DataChanged = DataChanged.Added
....
Then
End If
Next
End Sub

and the newly added and/or updated row via the paste is skipped right over.

Is there a way I can manually set these flags when a paste occurrs into my grid? I could catch the event on the client-side with AfterClipBoardOperation and then set it there, so on postback, my grid knows what was added or changed...

If I can't do this manually, then what is the value in having a grid that can have data pasted into it, only to not be able to act on that data when a grid is posted back?

Thanks,
Mike