Undo/Redo

Hi, I am doing Undo/Redo But Undo of the cell is happening but the Redo is not. I did following steps similar to the Undo Redo sample: this.m_PretestListingGrid.Model.CommandStack.Undo(); this.m_PretestListingGrid.Model.CommandStack.Redo(); After Undo when i checked the redo stack it is zero this.m_PretestListingGrid.Model.CommandStack.RedoStack.Count; Any idea why this is happening Thankz Pratiksha

3 Replies

AD Administrator Syncfusion Team December 17, 2004 09:29 AM UTC

Do you see the problem in our sample? It may have something to do with how you are triggerring the undo/redo. If you are using menu items or toolbar button, then the action is not triggerring validation. At the beginning of your menu/button handlers, try calling this.Invalidate() to see if this makes things work. If you can upload a sample showing the problem, we can try to debug it here.


AD Administrator Syncfusion Team December 20, 2004 07:23 AM UTC

hi, When i analysed below, I have PreprateviewStyleInfo in that i have following 3 lines If i comment out thses lines Redo works. Means they can not be done simultaneously? Where these 3 lines should be called so that m_PretestListingGrid.Model.Cols.FreezeRange(0,1); m_PretestListingGrid.Model.Cols.FreezeSelection(); //Hide the first column m_PretestListingGrid.Model.Cols.Hidden[0] = true; Where can above piece of the code called? because when i do cut insert column or cut insert row in every case i have to set these properties. >Do you see the problem in our sample? > >It may have something to do with how you are triggerring the undo/redo. If you are using menu items or toolbar button, then the action is not triggerring validation. At the beginning of your menu/button handlers, try calling this.Invalidate() to see if this makes things work. > >If you can upload a sample showing the problem, we can try to debug it here.


AD Administrator Syncfusion Team December 20, 2004 08:04 AM UTC

You should not do such code in PrepareViewStyleInfo as that event is raised too often for such code. I would wrap this code in a method, and then call this method whenever you need to, say after the line of code that you are using to cut/insert a row or column.

Loader.
Up arrow icon