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
Hello,
I have recently noticed that whenever I delete a row from my grid, the grid is not automatically refreshed, but the row is removed which causes the grid to confuse data and any subsequent rows deleted may delete an unintended row instead.
This can be replicated when the grid has 3 or more rows and any row above the bottom one is deleted. After one row is deleted, the rows below it will be incorrect and when called to be deleted will attempt to delete a row which was not intended. If the bottom row is deleted after any other, then it throws a NullReferenceException instead.
The code to initialize the grid and delete rows is as follows:
Private Sub Users_InitializeDataSource(sender As Object, e As ISNet.WebUI.WebGrid.DataSourceEventArgs) Handles Users.InitializeDataSource
e.DataSource = DA.ExecuteDataView(CommandType.Text, "SELECT * FROM TestTable")
End Sub
Protected Sub Users_DeleteRow(sender As Object, e As ISNet.WebUI.WebGrid.RowEventArgs) Handles Users.DeleteRow
Dim code As Byte = CByte(e.Row.KeyValue)
DA.ExecuteNonQuery(CommandType.Text, String.Format("DELETE FROM TestTable WHERE Id = {0}", code))
Hi James,
I have tried to replicate your issue by testing a sample which is closed to your description. The following are the step-by-step I used in my test:
Unfortunately, I could not replicate your issue. All row was deleted successfully. As a reference, I have attach the webgrid sample. Please have it evaluate on your end by adding it to webgrid sample included in installation folder. As a side note, you could trigger webgrid refresh action by "WebGrid1.ClientAction.Refresh()".
Best Regards,Leo
Hi Leo,
I have tested your sample, but it does not fix my problem, and adding the Grid.ClientAction.Refresh() code is not feasible as this fix is being made to a current application which didn't have this problem prior to version 8 of the WebGrid.
Here is a link to a sample project and database which contains the error I described earlier: https://www.dropbox.com/s/vuyas3mikkv3d4s/WebGridTest.zip?dl=0 . The steps to reproduce are exactly as follows:
1. Delete any row above the bottom.
2. Delete the bottom row.
This will cause a NullReferenceException as it does on my project. As I stated earlier this should not happen as the code for my project has not changed, but the WebGrid is acting completely differently between version 7 without the issue and version 8.
Regards,
James
Sorry for the delay. I have test the sample you have share with slight modification to fit my environment. The following are the step I used in my test:
Unfortunately the video seems to have been corrupted so I cannot view it. If you could reupload it that would be quite helpful.
I would like to know if you used VB code for the testing or if you translated it into C#? Also could you tell me what other changes had to be made to the project in order for it to run? Perhaps you could upload your copy as well as I would like to make sure it is a close to my current code as possible to give an accurate test.
I have re-upload the video. Please find the video on attachment.
FYI, The only changes that has been made to your project was the connection string to the database.
Thanks for helping with this so far, and I have one last request. If you could please try again to reproduce this issue, but instead delete the top row first, then the bottom row second.
It seems I was incorrect before as the second last row does not cause the issue. It seems that the issue happens when any row 2 or more above the bottom row is deleted before the bottom.
Thanks for your information. I have report this to WebGrid development team under 'ASPNET-157'. I will get back at you if there is an update.
Regards,Leo
Could you possibly give me a timeline for this fix?
Please expect a fix for this issue to be ready before the end of April.
Hello Leo,
It is nearing the end of April and I would like to know if the fix will be released soon, If not, could I get a more accurate estimate.
I am sorry to inform you that the fix for 'ASPNET-157' will be delayed. I wil give you an update on any news I heard about 'ASPNET-157'.
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