Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
90
Ultrawebgrid events
posted

Hey all,

     I'm really new to Infragistics. I'm working in ASP.NET, 2.0 in C#.  I've got a grid on a webform that does an export to Excel. The webform is a child form. The exporting feature works fine. Downloads with no trouble. Question - I need to make the webform with the grid on it close right after the download.  Is there an event that I can subscribe to that would work? I've looked at EndExport, but I am not sure when it fires.  It sure doesn't ever seem to be raised.

Thanks in advance for your help.

 

  • 45049
    Suggested Answer
    posted

    The issue here is that there's no event available for us to expose to allow a programmer to do this.

    When you export WebGrid to an Excel file, the response sent from the server to the client is the Excel file created.  What you need is something that you can respond to.

    On the server, you have events such as EndExport - which should be raised when the export process has completed creating the Excel output (and before that output is sent to the client).  However, you can't close a window on a client machine directly from server-side code.  So, server-side events won't work for this.

    As far as the client is concerned, it's receiving a new response.  Since that response is an Excel file, and thus contains no HTML that it can process, it doesn't raise any events.  It's also not possible to embed from the server any JavaScript you could run on the client; since the response isn't HTML, you can't embed JavaScript to be run.  So, there are also no client-side processes that will work for this.

    I'd like to see a way to make this functionality work myself.  My understanding is, due to the way browsers process responses for non-HTML file types, that this isn't possible.