iSeller Commerce
iSeller POS Retail
iSeller POS F&B
iSeller POS Express
Crosslight
WebUI
ClientUI
What's New
Download Trial
Web Solution
Mobile Solution
Enterprise Solution
Custom Development
Blog
Community
Latest Development Blogs
ForumPostTopic
Browse By Tag
Hi,
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.
My Questions are
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
public void Clear()
{
foreach(WebGridRowChanges row in WebGrid1.GetChanges())
row.RowState = RowState.UnModified;
}
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
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.
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 ?
Please reply asap.
Thanks
Dhaval
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.
function Button2_onclick() { var grid = ISGetObject("WebGrid1"); grid.UndoAllChanges(); return true; }
...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 ?
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.
or
Choose this if you're already a member of Intersoft Community Forum. You can link your OpenID account to your existing Intersoft Social ID.
Choose this if you don't have an Intersoft account yet. Your authenticated OpenID will be automatically linked to your new Intersoft account.
Enter your Wordpress Blogname