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

Undo Deletion of a Record

Thread ID:





127530 Nov 21,2016 04:19 PM UTC Nov 22,2016 05:46 AM UTC WinForms 1
Tags: GridGroupingControl
Swetaketu Majumder
Asked On November 21, 2016 04:19 PM UTC


I want to create an option to 'undo' a deletion from the grid. I saw in the documentation that I can easily delete record(s) using this.gridGroupingControl1.Table.Records.DeleteRecords(rec); But is there a way to 'undo' it?

Alternatively, is there a way to hide/unhide selected records from the grid grouping control?


Piruthiviraj Malaimelraj [Syncfusion]
Replied On November 22, 2016 05:46 AM UTC

Hi Swetaketu, 

Thanks for your interest in Syncfusion products. 

We have analyzed your scenario and created the simple sample as per your requirement. In order to hide/unhide the records of grid, AddRange/Remove methods of RowHiddenEntries can be used. Please make use of the below code, 
Code example: 
void chk_hide_CheckStateChanged(object sender, EventArgs e) 
    GridRowHidden[] hiddenrows; 
    if (chk_hide.Checked) 
        int n = this.gridGroupingControl1.Table.SelectedRecords.Count; 
        int rowIndex; 
        hiddenrows = new GridRowHidden[n]; 
        for (int i = 0; i < n; i++) 
            rowIndex = this.gridGroupingControl1.Table.SelectedRecords[i].Record.GetRowIndex(); 
            hiddenrows[i] = new GridRowHidden(rowIndex); 
        //Hide the selected rows. 
        //Unhide the selected rows. 
        while (this.gridGroupingControl1.TableControl.Model.RowHiddenEntries.Count > 0) 
Sample link: 

Please refer the below KB for further references, 



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.

Please sign in to access our forum

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

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