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
I have a webgrid with a SQL Server datasource in a window with a lot of other information. The webgrid will never have more than page, but it does scroll.
I want the user to be able to edit a single column in the grid without committing the data to the database. At the bottom of the window is an "ok" button, and I want to be able to then programmatically, on the server side, grab the information and save it myself.
I've played around with many different settings, but I either
a) lose the data as soon as the cell changes, or the control loses focus, or
b) lose the data during postback, or
c) get update errors, or
d) show a SmartUpdate ribbon, which I don't want shown
This is an issue that will come up many times for our company; any assistance is greatly appreciated!
Thanks,
Beryl
The most recent version of WebGrid, WebGrid 7.0, has a major feature called “SmartBatchUpdate™” that will suit your requirement best. This new technology enables your end user to make multiple changes to the data in the client side, while at the same time maintaining the changes as they navigate the data around.
Embracing elegant pending changes architecture, WebGrid submits all changes to server-side in a single request - making data update fast and efficient. Please see SmartBatchUpdate&trade overview to learn the fundamental concept of this new feature.
WebGrid 7's batch update also supports advanced data transaction operations such as cascading inserts, hierarchical tables, automatic object updates, identity insert handling and more. The user interface has also been improved to provide users with intuitive way to review and manage the changes. Learn more about user interface improvements such as call out notification, changes status and more.
For more information about the concept of this feature, you can visit following post, http://intersoftpt.wordpress.com/2009/03/09/batch-update-webgrid-enterprise-7/, in our official blog. We also have another post that discuss about physical database update in http://intersoftpt.wordpress.com/2009/04/09/physical-database-update-in-smartbatchupdate/.
You might want to check our live sample of SmartBatchUpdate™ in http://live.intersoftpt.com/Default.aspx?url=cs/WebGrid/ClientBinding_BatchUpdate.aspx.
Thank you for your help. I have used SmartBatchUpdate and I have a couple of significant issues remaining:
- When I have a postback on a different control (e.g., a drop-down listbox on the page), I receive the message "Are you sure you want to navigate away from this page?" This is confusing the the user because they are not navigating away from the page, they are simply entering another value on the page. How do I get the grid to not give that message?
- I'd prefer not to see the ribbon with the accept / cancel pending changes.
I tried all the samples, but every one of them seems to give this message as well. Please help!
Below is the code for the webgrid:
</LayoutSettings>
Q: When I have a postback on a different control (e.g., a drop-down listbox on the page), I receive the message "Are you sure you want to navigate away from this page?" This is confusing the the user because they are not navigating away from the page, they are simply entering another value on the page. How do I get the grid to not give that message?
A: In order to remove the “Are you sure you want to navigate away from this page?” message; please disable the “PromptUnsavedChanges” property WebGrid BatchUpdateSettings by setting its value to “False”. This property specifies whether users should be prompted during page unload (due to navigation or window close or postback action) while there are unsaved changes in the grid. By default, this property is enabled.
<ISWebGrid:WebGrid ID="WebGrid1" runat="server" ...> <LayoutSettings AllowBatchUpdate="True"> <BatchUpdateSettings PromptUnsavedChanges="False" /> </LayoutSettings> ... </ISWebGrid:WebGrid>
Q: I'd prefer not to see the ribbon with the accept / cancel pending changes. I tried all the samples, but every one of them seems to give this message as well. Please help!
A: In WebGrid BatchUpdateSettings, there is a property named “AllowUndoChanges”. This property specifies whether or not user is allowed to undo pending changes. By default, this property is enabled.
You need to disable this property by setting its value to “False” in order to have the cancel pending changes to be invisible.
<ISWebGrid:WebGrid ID="WebGrid1" runat="server" ...> <LayoutSettings AllowBatchUpdate="True" StatusBarVisible="false"> <BatchUpdateSettings AllowUndoChanges="False"/> </LayoutSettings> ... </ISWebGrid:WebGrid>
There is no property to set the visibility of the accept pending changes, so we’ll need to access the element of the button and simply set the display property of the button to “none”.
function RemoveAcceptChangesButton() { var WebGrid1 = ISGetObject("WebGrid1"); WebGrid1.GetElement(WG40.STATUSBARCOMMAND, WG40.HTMLROW).cells[3].childNodes[0].childNodes[0].childNodes[0].childNodes[1].style.display = "none"; return true; }
Thanks for your help! I did the first bit, so that the webgrid code looks like this:
However, now when I make a change in the grid I get the error message:
Microsoft JScript runtime error: 'undefined' is null or not an object
on the line:
textE1.innerHTML =this.GetString("CommonText/PendingChanges").replace("{0}",count);
Can you help? Thank you!
On a second question: I've found a work-around where I don't use SmartBatchUpdating, but rather use a temporary table with real-time updates. This works for me, except: the webgrid is in a dialog box with many other controls, called from another page. It only works every other time. The first time the dialog box is called, the webgrid fills in nicely. If I cancel and go back, all my controls are there except the webgrid, which is empty. If I cancel again and go back, the webgrid is good.
A solution to either of these issues would work for me!
Microsoft JScript runtime error: 'undefined' is null or not an objecton the line: textE1.innerHTML =this.GetString("CommonText/PendingChanges").replace("{0}",count);Can you help? Thank you! Beryl
In order to get this issue resolved, you need to set the WebGrid’s status bar to be visible by enabling the StatusBarVisible property of WebGrid.
When using SmartBatchUpdate™, we need to set the status bar to be visible.
On a second question: I've found a work-around where I don't use SmartBatchUpdating, but rather use a temporary table with real-time updates. This works for me, except: the webgrid is in a dialog box with many other controls, called from another page. It only works every other time. The first time the dialog box is called, the webgrid fills in nicely. If I cancel and go back, all my controls are there except the webgrid, which is empty. If I cancel again and go back, the webgrid is good.A solution to either of these issues would work for me!
We are willing to advise you further but in order to do so we would need you to elaborate on your specific work-around and possibly give us a running simple sample work-around technique that you are currently use (plus step-by-step guide) that we can use to observe the problematic behavior.
Thank you! I'll try the Ribbon = true for the SmartBatchUpdate. In the meantime, I found the solution to the second question. Instead of just doing a databind() to refresh the datasource, if I do a
webGrid1.ClientAction.Refresh();
it works perfectly, so I'm good. I'll play with the SmartBatch once I get a second and post my results here.
Glad to hear that you have finally found the solution of the second question. I look forward to hearing good news from you with the usage of SmartBatchUpdate™ feature.
Should you need further assistance or run into any problems regarding our controls, feel free to post it into our forum. We would be happy to assist you again.
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