﻿<?xml version="1.0" encoding="utf-8"?><rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:media="http://search.yahoo.com/mrss/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0"><channel><title>Intersoft Community - WebGrid Enterprise - Undo Changes to WebGrid 7 in Batch Edit Mode WebGrid 7.0</title><link>http://www.intersoftsolutions.com/Community/WebGrid/Undo-Changes-to-WebGrid-7-in-Batch-Edit-Mode-WebGrid-70/</link><description /><generator>http://www.intersoftsolutions.com</generator><language>en</language><copyright>Copyright 2002 - 2015 Intersoft Solutions Corp. All rights reserved.</copyright><ttl>60</ttl><item><title>Undo Changes to WebGrid 7 in Batch Edit Mode WebGrid 7.0</title><link>http://www.intersoftsolutions.com/Community/WebGrid/Undo-Changes-to-WebGrid-7-in-Batch-Edit-Mode-WebGrid-70/</link><pubDate>Mon, 12 Apr 2010 04:47:39 GMT</pubDate><dc:creator>yudi</dc:creator><description>&lt;p&gt;&lt;span style="font-family: 'segoe ui','sans-serif'; color: #1f497d; font-size: 9pt"&gt;I’d like to suggest you to use UndoAllChanges() method from client side event. Calling the method will undo all pending changes regardless of the state and table. Below is the snippet code that shows the implementation of UndoAllChanges() method.&lt;/span&gt;&lt;/p&gt;&lt;pre&gt;function Button2_onclick() {
    var grid = ISGetObject("WebGrid1");

    grid.UndoAllChanges();

    return true;
}&lt;/pre&gt;&lt;blockquote&gt;&lt;p&gt;...&lt;br /&gt;2) I am using a feature provided by WebGrid 7, by which a pop shows up asking the user to confirm if they really want to navigate away from the page, if there are pending changes to the grid. BUT the problem is that the pop up appears TWICE. I do not understand why, is it because the grid is being used inside a user control, and that control is a part of an aspx page ?&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;&lt;span style="font-family: 'segoe ui','sans-serif'; color: #1f497d; font-size: 9pt"&gt;The feature/property that will pop up asking the user to confirm if they really want to navigate away from the page if there are any pending changes to the grid is called “PromptUnsavedChanges”. I was unable to repro the issue that has the pop up appears twice when use the grid as user control. Do you have any running simple sample that replicates the issue? You can use any data source available in WebGridSamples project as the data source of the grid. If you do able to repro the issue in a running simple sample, please send the sample to us for further investigation. &lt;/span&gt;&lt;/p&gt;</description></item><item><title>Undo Changes to WebGrid 7 in Batch Edit Mode WebGrid 7.0</title><link>http://www.intersoftsolutions.com/Community/WebGrid/Undo-Changes-to-WebGrid-7-in-Batch-Edit-Mode-WebGrid-70/</link><pubDate>Sat, 10 Apr 2010 09:42:45 GMT</pubDate><dc:creator>dhavalv</dc:creator><description>&lt;p&gt;Hi, &lt;/p&gt;
&lt;p&gt;I am using WebGrid 7.0 in a user control that forms a part of .aspx page. The Webgrid is used to show data based on the options user select in the tree view control which is a part of the .aspx page, by setting a different datasource for the same webgrid.&lt;/p&gt;
&lt;p&gt;My Questions are &lt;/p&gt;
&lt;p&gt;1) When there are unsaved pending changes to a grid, and if I want to assign a new datasource to the grid, how can I undo the changes that are aready made to the grid. On the server side I have a method like&lt;/p&gt;
&lt;p&gt;public void Clear()&lt;/p&gt;
&lt;p&gt;{&lt;/p&gt;
&lt;p&gt;      foreach(WebGridRowChanges row in WebGrid1.GetChanges())&lt;/p&gt;
&lt;p&gt;      {&lt;/p&gt;
&lt;p&gt;        row.RowState = RowState.UnModified;&lt;/p&gt;
&lt;p&gt;      }&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;Doing the above before assigning the new datasource to the webgrid, clears the edited styling from the grid when the new data is rendered on the WebGrid, but the grid still shows having "{0} pending changes".  Is there something I need to execute at the client side as well, to undo all the pending changes associated with the grid. I am aware of the methods on the client side which you can use like &lt;/p&gt;
&lt;p&gt;WebGrid1.UndoChanges() or WebGrid.RootTable.UndoAllChanges(), but I do not know the exact WebGrid event on the client side where I should call this method. I tried to call the WebGrid1.UndoChanges() method on the client side event of "AfterInitialize()" but it did not work. It only works if I call using a setTimeOut() method on the client side, as I guess it does some synchronization on the client side to restore the pending changes after it executes "AfterInitialize" event on the client side.&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;2) I am using a feature provided by WebGrid 7, by which a pop shows up asking the user to confirm if they really want to navigate away from the page, if there are pending changes to the grid. BUT the problem is that the pop up appears TWICE. I do not understand why, is it because the grid is being used inside a user control, and that control is a part of an aspx page ?&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;Please reply asap.&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;Thanks&lt;/p&gt;
&lt;p&gt;Dhaval&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;</description></item></channel></rss>