From 23f562c44296128c8ac362f4737cc86fad9203d2 Mon Sep 17 00:00:00 2001 From: Sreemon Premkumar M Date: Tue, 19 Aug 2025 19:22:46 +0530 Subject: [PATCH 1/3] ES-975464 - Resolve the ReadMe file length issue in this sample repository --- README.md | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index eba6415..315de94 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,27 @@ # how_to_discard_all_changes -This sample explains how to undo and redo all the unsaved changes in Spreadsheet + +This sample explains how to undo and redo all the unsaved changes in [WPF Spreadsheet](https://www.syncfusion.com/wpf-controls/spreadsheet). + +By default, all the unsaved changes are maintained in the `UndoStack` commands collection. To discard all the unsaved changes programmatically, `Execute` the all commands in `UndoStack` collection. By executing the commands in `RedoStack` commands collection, all the discarded changes can be retrieved. + +``` c# +//UndoAll the changes +while (this.spreadsheetControl.HistoryManager.UndoStack.Count > 0) +{ + var undo = this.spreadsheetControl.HistoryManager.UndoStack.Pop(); + if (undo != null) + { + undo.Execute(Syncfusion.UI.Xaml.Spreadsheet.History.CommandMode.Undo); + } +} + +//RedoAll the changes +while (this.spreadsheetControl.HistoryManager.RedoStack.Count > 0) +{ + var redo = this.spreadsheetControl.HistoryManager.RedoStack.Pop(); + if (redo != null) + { + redo.Execute(Syncfusion.UI.Xaml.Spreadsheet.History.CommandMode.Redo); + } +} +``` \ No newline at end of file From 23ce38ac02eb1e2f7675ec5addfcf4040ed390f2 Mon Sep 17 00:00:00 2001 From: Sreemon Premkumar M Date: Tue, 19 Aug 2025 19:24:13 +0530 Subject: [PATCH 2/3] ES-975464 - Modified the title --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 315de94..3e10931 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# how_to_discard_all_changes +# How to discard all changes This sample explains how to undo and redo all the unsaved changes in [WPF Spreadsheet](https://www.syncfusion.com/wpf-controls/spreadsheet). From 76bff78e0cfc96d01e0890cee8b016678b179a98 Mon Sep 17 00:00:00 2001 From: SreemonPremkumarM Date: Fri, 7 Nov 2025 09:33:38 +0530 Subject: [PATCH 3/3] Update README.md --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 3e10931..6337681 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,8 @@ -# How to discard all changes +# How to Discard all the Changes in WPF Spreadsheet? -This sample explains how to undo and redo all the unsaved changes in [WPF Spreadsheet](https://www.syncfusion.com/wpf-controls/spreadsheet). +This sample explains how to undo and redo all the unsaved changes in [WPF Spreadsheet](https://www.syncfusion.com/wpf-controls/spreadsheet) (SfSpreadsheet). -By default, all the unsaved changes are maintained in the `UndoStack` commands collection. To discard all the unsaved changes programmatically, `Execute` the all commands in `UndoStack` collection. By executing the commands in `RedoStack` commands collection, all the discarded changes can be retrieved. +By default, all the unsaved changes are maintained in the **UndoStack** commands collection. To discard all the unsaved changes programmatically, **Execute** the all commands in **UndoStack** collection. By executing the commands in **RedoStack** commands collection, all the discarded changes can be retrieved. ``` c# //UndoAll the changes @@ -24,4 +24,4 @@ while (this.spreadsheetControl.HistoryManager.RedoStack.Count > 0) redo.Execute(Syncfusion.UI.Xaml.Spreadsheet.History.CommandMode.Redo); } } -``` \ No newline at end of file +```