We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

Flush Current Row Changes Back to ItemsSource (DataView)

Hello...

Any idea on the best way to flush changes to the current row, back to the ItemsSource without moving off the row? If you run the attached example and enter some numbers into the first row and then without moving off it click on "No Of Changed Rows" you will see that the changes made to the first row are not available to the underlying DataTable. Ideally, a user would be able to enter a number into just 1 cell and then click an Update button to write the changes back to the database.

Many thanks

Peter

Attachment: TestWPF_8627de9d.zip

3 Replies

ES Elangovan S Syncfusion Team August 14, 2015 10:39 AM UTC

Hi Peter,

Thank you for using Syncfusion products,

You can commit the changes into the ItemsSource once you complete the editing of the cell without moving to next row by calling SfDataGrid.View.CommitEdit method in SfDataGrid.CurrentCellEndEdit event. Please find the attached sample.

Sample Link

CurrentCellEndEdit event triggered,


<syncfusion:SfDataGrid
                x:Name="sdgGrid1"
                Grid.Row="1"
                LiveDataUpdateMode="AllowDataShaping"
                Margin="3,3,3,3"
                AllowEditing="True"
                ScrollViewer.VerticalScrollBarVisibility="Visible"                
                CurrentCellEndEdit="sdgGrid1_CurrentCellEndEdit" />

 
 


Private Sub sdgGrid1_CurrentCellEndEdit(sender As Object, args As CurrentCellEndEditEventArgs)

        If (sdgGrid1.View.IsEditingItem) Then

            sdgGrid1.View.CommitEdit()

        End If
End Sub



Please let me know if you have any queries.

Regards,
Elangovan S


PA Peter Aldersley August 14, 2015 11:01 AM UTC

Thank you Elangovan... that works a treat!

Peter


ES Elangovan S Syncfusion Team August 17, 2015 04:19 AM UTC

Hi Peter, 
 
Thanks for your Update. 
 
Please let us know if you need further assistance.
 
Regards,
Elangovan S

Loader.
Live Chat Icon For mobile
Up arrow icon