Prevent User from closing the radwindow

3 posts, 0 answers
  1. anvesh amaravadi
    anvesh amaravadi avatar
    10 posts
    Member since:
    Nov 2009

    Posted 14 Sep 2010 Link to this post

    Hi

    I want to prevent a user closing the radwindow (which pops up by clicking on a row in a grid) without entering some data
    I have tried onUnload and onBeforeUnload event but my telerik window runs those events after i close the window

    Ex: If a click a row window pops up and then i close it and then If i try to open pop up by clicking on a different row then the onunload and onbeforeunload events are running

    Do you have any idea how to prevent a user closing the window

    by giving an alert or by disabling the close button on top (ofcourse we have customized close button on the page)

    I have to allow user if he enters data or prevent him if doesn't enter
    is there a way to do it for radwindow
  2. Cori
    Cori avatar
    562 posts
    Member since:
    Jul 2010

    Posted 15 Sep 2010 Link to this post

    You should handle the RadWindow's OnClientBeforeClose event. The reason for your onUnload and onBeforeUnload events not being fired is because the RadWindow is just a container for an iFrame control, so it's technically just hiding itself and not closing the page, so those page events don't get raised until the control gets reloaded by the other row selection, thus causing your current situation.

    So if you handle the RadWindow's OnClientBeforeClose you will be able to determine if the user made any changes and then alert them and prevent the window from closing.

    I hope that helps.
  3. anvesh amaravadi
    anvesh amaravadi avatar
    10 posts
    Member since:
    Nov 2009

    Posted 15 Sep 2010 Link to this post

    Thanks for your reply cori

    I did, and it worked
    thank you
Back to Top