)
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. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to reject the changes made in the WinForms GridGroupingControl?

Platform: WinForms |
Control: GridGroupingControl |
Published Date: April 30, 2011 |
Last Revised Date: February 12, 2020

Reject the changes

By default, any change made to the GridGrouping control affects the underlying DataSource. The RejectChanges() method rejects the recent changes made to the DataSource without being saved. Ensure that the AcceptChanges() method is called after the DataSource is filled as the RejectChanges method rolls back all the changes made to the DataSource since the last call of the AcceptChanges method.

C#

private void btn_reject_Click(object sender, EventArgs e)
{
    DataTable dt = this.gridGroupingControl1.DataSource as DataTable;
    //Rolls back all the changes made to the table since it was loaded or after the AcceptChanges() was called.
    dt.RejectChanges();
}
private void btn_accept_Click(object sender, EventArgs e)
{
    DataTable dt = this.gridGroupingControl1.DataSource as DataTable;
    //Commits all the changes made to the table.
    dt.AcceptChanges();
}

VB

Private Sub btn_reject_Click(ByVal sender As Object, ByVal e As EventArgs)
    Dim dt As DataTable = TryCast(Me.gridGroupingControl1.DataSource, DataTable)
    'Rolls back all the changes made to the table since it was loaded or after the AcceptChanges() was called.
    dt.RejectChanges()
End Sub
Private Sub btn_accept_Click(ByVal sender As Object, ByVal e As EventArgs)
    Dim dt As DataTable = TryCast(Me.gridGroupingControl1.DataSource, DataTable)
    'Commits all the changes made to the table.
    dt.AcceptChanges()
End Sub

Samples:

C#: Rejecting_changes_in_GGC

VB: Rejecting_changes_in_GGC

2X faster development

The ultimate WinForms UI toolkit to boost your development speed.
ADD COMMENT
You must log in to leave a comment

Please sign in to access our KB

This page will automatically be redirected to the sign-in page in 10 seconds.

Up arrow icon

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

Live Chat Icon For mobile
Live Chat Icon