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.
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Flush Current Row Changes Back to ItemsSource (DataView)

Thread ID:

Created:

Updated:

Platform:

Replies:

119915 Aug 13,2015 04:20 AM Aug 17,2015 12:19 AM WPF 3
loading
Tags: SfDataGrid
Peter Aldersley
Asked On August 13, 2015 04:20 AM

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

Elangovan S [Syncfusion]
Replied On August 14, 2015 06:39 AM

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

Peter Aldersley
Replied On August 14, 2015 07:01 AM

Thank you Elangovan... that works a treat!

Peter

Elangovan S [Syncfusion]
Replied On August 17, 2015 12:19 AM

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

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;