Kendo Upload in Grid Popup Editor: How to prevent window close when upload throw exception
<p>I do not know if this is a strange case, but I can hardly find similar situation on the web.</p>

<p>What I've got is a Kendo Upload Control (async upload multiple files), in a Kendo Grid Popup Editor Template.</p>

<p>I am trying to implement the follow behavior:</p>

<ul>
<li>User may select multiple files from the upload control, but not yet upload.</li>
<li>When user clicks on the default "update" button of the popup window, triggers the upload control's async upload action.</li>
<li>If user clicks on "cancel" button or closes the window, without clicking "update", the window is closed and the selected files are not uploaded.</li>
<li>When all files are uploaded successfully, the popup window is closed and the grid gets refreshed.</li>
</ul>

<p>I have already implemented the above functionality without any problem (Even though, I have to intercept many Kendo Control's javascript).</p>

<p><strong>My problem is the following:</strong></p>

<ul>
<li>If the total file size (in DB + pending one) is bigger than a certain amount, then as a server validation, I throw an exception from server, <strong>no files are uploaded</strong>, and the <strong>popup window should not be closed,</strong> while an error message will display on the popup window.</li>
<li>If user gets to the above point and selects other files, the previous selected pending files will be cleared and will behave just like a brand new cycle.</li>
<li>If user gets to the above point and clicks the "cancel" button or clicks the "X" icon, the window should be closed.</li>
</ul>

<p>I can find no easy way to implement this.</p>

<p>What I was able to find related to this was <a href="http://www.telerik.com/support/code-library/upload-in-grid-popup-editor" rel="nofollow">Upload in Grid Popup editor</a>.</p>

<p>But, it still does not show how I can catch my own Exception in front-end, stop the window from closing, and display the error message.</p>

<p>Please provide any advice! Thanks!</p>