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
We are using WebGrid 7.0 in SharePoint Web part , we have a self refrencing editable grid and rendering the web grid programatically.
We have certain BatchUpdate issue on which WebGrid development team from Intersoft is working hence i am trying to figur out old value and new value of perticular cell by means of inspecting DataTable which is assigned to WebGrid as data source.
I am using following code to check what was the old cell value of the web grid before the grid cell was modified.
DataTable dtMyTasks = interSoftWebUIGrid.DataSource as DataTable;
DataRow[] dataRowArray = dataTableInstance.Select(null,null,DataViewRowState.OriginalRows); DataRow originalDataRow = dataRowArray[rowIndex][columnIndex, DataRowVersion.Original]
But in above code originalDataRow surpricingly refers to the latest cell value instead of original cell value .
Any idea ?
Hi Gaurav,
Forgive me if I made mistakes. However, after I confirmed with Yudhi, the work item #689 is about using a client side event of AcceptAllChanges that does not work properly. Yet, this work item is made because the server side of performing batch update is not succeed.
And now, I believe we do not need to trigger the client side event on AcceptAllChanges for work around in order to perform server side batch update.
On the last post, I attached you a simple sample on how to perform that scenario. Here is the snippet:
protected void Button3_Click(object sender, EventArgs e) { WebGrid1.PerformBatchUpdate(true, true); WebGrid1.RebindDataSource(); }
I hope it will clear all the ambiguity that occurred. Thank you and have a nice day.
Best Regards,
Andi Santoso
WebGrid has OnBatchUpdate server side event that always be invoked when batch update feature is enabled. This event is required to be handled for traditional and custom object binding. You can use GetChanges method at WebGrid or WebGridTable object to get the desired changes and the original value.
For example, you can get the new text and value as well as the old one in WebGrid1.GetChanges()[0].Data[0].
Following link, http://support.intersoftpt.com/Docs/WebGrid/7.0.7200/Server-side Programmability.html, showing the server-side programmability that related to WebGrid BatchUpdate feature.
Dear Yudi,
If you read through my post again, i have mentioned that your development team is working on the BatchUpdateIssue which Nikhil/Mukul my managers here have posted on which your team is hopefully working right now (the issue of AcceptAllChanges not workign in the night build ) . So untill we get a fix/night build for batchUpdte Can you please tell me why above code snippet is not working ?
We cannot use that approach to retrieve the old and new value of a BatchUpdate WebGrid. What you might want to do is, as like my colleague mentioned about retrieve changes in WebGrid. Here is the snippet to do so:
protected void WebGrid1_BatchUpdate(object sender, ISNet.WebUI.WebGrid.BatchUpdateEventArgs e) { string newValue = WebGrid1.GetChanges()[0].Data[0].NewValue.ToString(); string oldValue = WebGrid1.GetChanges()[0].Data[0].OldValue.ToString(); }
I hope it helps you . Thank you and have a nice day.
God..you are again and again giving me same solution.
UNTILL THE INTERSOFT TEAM Resolves the issue with batch update I CAN NOT USE BATCH UPDATE feature in my grid. I think the work item was #689.
BatchUpdate is not enabled right now in my grid. Now can you please tell me why the work around i am using doese not work or suggest me some other work around.
Thank you.
Sorry for misinterpret. I have tried your provided code and I have modified them a little bit. I have tested them and it worked. It will show me the original value instead of the new value inserted.
I have attached you a simple sample. In this sample, it will give us an alert for the old value after we updated the "ShipVia" row or the 6th column index on the first row.
I hope it can help. Thank you and have a nice day.
Yes, the sample application works but is that a limitation that only in UpdateRow event i will be able to get Old row ? Is not there any way where in on the click of some server side button i check for old valules for specified column in list of data rows ?? It seems after UpdateRow event internally data table's acceptChanges event is called ?
My rqeuirement is to get all old and new value for list of modified rows on clic of a server side button and not on update row event. Of course as a work around i can store these old and new value in some in memory obejct like session on updaterow event but it is not recommanded approach to store too much values in session.
If I am not mistaken, you were trying to perform BatchUpdate from server side. I have got a good news regarding this. Our developer has fixed this issue. You can get the latest build of WebGrid in here. However, this is a nightly build, disclaimer is on and any feedback regarding this issue is truly appreciated since this build has not been intensively tested.
I also attached you a simple sample on how to perform BatchUpdate from server side. Hopefully, this can help you. Thank you and have a nice day.
Andi,
Yudi has already given this night build to us earlider where you team had fixed work item #676
So, we had another issue with that night build release which i reported back to Yudi and he said it is an issue with the grid and they raised another work item #689 which to my knowledge is not yet fixed.
NOW CAN YOU TELL ME THAT the build given in the linke above given by you is fix for #689 or that is not yet resolved ????
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