Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
140
Grid Undo History
posted

I have created a calculator like function to allow the user to update all cells in a given column.  I loop through each cell in the column and change the value based on user input.  What I would like is to have the ability for the user to undo what was done to each cell in one undo click.  Is this possible with the built in undo button, or would a custom undo be required?  If the latter, what properties should I be looking at to make it work?

Parents
  • 69686
    posted

    Hello,

    What you can do is call the DataPresenterCommands.Undo as many times as the number of changes you have made. However, currently there is no property exposed on the XamDataGrid to know how many actions you should undo (please note that actions like resizing, etc can also be undo-ed).

    private void button1_Click(object sender, RoutedEventArgs e)

            {

                xdg.ExecuteCommand(DataPresenterCommands.Undo);

            }

    You could create a custom code that will keep track of this.

    You may also want to submit a feature request for adding a property or a collection, showing how many actions can be undo-ed here.

Reply Children