Hello all!
I am using a RadGrid with a custom User Control as both the insert and edit form. Within the User Control, I've defined two linkbuttons (for insert/update and for cancel) as follows:
The actual insert (or update) logic is performed in the grid's OnInsertCommand and OnUpdateCommand handlers. In this particular scenario, when the user performs the insert action, a number of things are going on behind the scenes (including some calculations that take a couple of seconds to complete). During this time, the User Control form stays visible to the user. I've added a Javascript function to the click event on the linkbutton in which I am displaying an hourglass cursor while the progress completes.
The problem I'm experiencing is that the users are impatient, and are ignoring the wait cursor and repeatedly clicking on the Insert/Update link button while the popup is visible. This is resulting in multiple, identical rows being added to the grid. Indeed, you can see this behavior in the Telerik example of a User Control edit form at this page here - enter new data in the edit form and click on the Insert button repeatedly. The row will be entered multiple times.
I haven't found a way to effectively disable the link button upon the click event without breaking other RadGrid behavior. For example, within the Javascript click() handler, I've tried both disabling the button as well as clearing the href attribute; both actions prevent the RadGrid from successfully closing the popup once the insert is done.
Has anyone encountered this issue and, if so, have a workaround?
I am using a RadGrid with a custom User Control as both the insert and edit form. Within the User Control, I've defined two linkbuttons (for insert/update and for cancel) as follows:
<asp:LinkButton ID="lkbUpdate" ValidationGroup="LocDetail" |
Text='<%# (Container is GridEditFormInsertItem) ? "Insert" : "Update" %>' |
runat="server" OnClientClick="Insert_Click();" |
CommandName='<%# (Container is GridEditFormInsertItem) ? "PerformInsert" : "Update" %>'> |
</asp:LinkButton> |
<asp:LinkButton ID="lkbCancel" Text="Cancel" runat="server" CausesValidation="False" |
CommandName="Cancel"> |
</asp:LinkButton> |
The actual insert (or update) logic is performed in the grid's OnInsertCommand and OnUpdateCommand handlers. In this particular scenario, when the user performs the insert action, a number of things are going on behind the scenes (including some calculations that take a couple of seconds to complete). During this time, the User Control form stays visible to the user. I've added a Javascript function to the click event on the linkbutton in which I am displaying an hourglass cursor while the progress completes.
The problem I'm experiencing is that the users are impatient, and are ignoring the wait cursor and repeatedly clicking on the Insert/Update link button while the popup is visible. This is resulting in multiple, identical rows being added to the grid. Indeed, you can see this behavior in the Telerik example of a User Control edit form at this page here - enter new data in the edit form and click on the Insert button repeatedly. The row will be entered multiple times.
I haven't found a way to effectively disable the link button upon the click event without breaking other RadGrid behavior. For example, within the Javascript click() handler, I've tried both disabling the button as well as clearing the href attribute; both actions prevent the RadGrid from successfully closing the popup once the insert is done.
Has anyone encountered this issue and, if so, have a workaround?