This is a migrated thread and some comments may be shown as answers.

Duplicate insertion bug

1 Answer 55 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Tim
Top achievements
Rank 1
Tim asked on 20 Jun 2014, 01:04 PM
Hi Telerik,

I'm facing an undesired duplicate recording problem with RadGrid when the user accidentally hit the insert link more than once.

The radgrid will execute the insertion twice, I've tried some solution such as Response.Redirect to the same page in the OnItemInserted event, but it will not help due to the fact that the insert command is already sent twice.

I came across a post in the forum mentioning the same issue here, but the admin seems to have misunderstood the question, much appreciated if this time someone can give a better instruction on the problem.

If one double-click can't mimic the problem, click on the insert link nonstop with certain frequency until the page is refreshed, you'll see multiple same record are inserted into the radgrid.

Hope I'm clear here.

Best regards.

1 Answer, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 21 Jun 2014, 05:35 AM
Hi Tim,

When once the Insert button is clicked, the editform closes. In-case the Insert takes time, you can show a loading panel as shown in this demo. Another approach is you will need to wire the InsertCommand event and perform required checks in its event handler. If the item is duplicated you can set e.Canceled to true. Thus the insert command will be stopped.

Thanks,
Princy
Tags
Grid
Asked by
Tim
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Share this question
or