closing form with the last radpageviewpage close button

2 posts, 0 answers
  1. ricric
    ricric avatar
    12 posts
    Member since:
    Sep 2010

    Posted 30 Apr 2011 Link to this post

    hi..
    i have radpageviewpage with the close button element, i want when i close the last radpageviewpage, the form will close automatically too, how can i do it?
    thanks for your help.
  2. Emanuel Varga
    Emanuel Varga avatar
    1336 posts
    Member since:
    May 2010

    Posted 01 May 2011 Link to this post

    Hello,

    A very easy way would be to just register for the PageRemoved event and if there are no other pages just close the form.

    private void radPageView1_PageRemoved(object sender, Telerik.WinControls.UI.RadPageViewEventArgs e)
    {
        if (radPageView1.Pages.Count == 0)
        {
            this.Close();
        }
    }

    For more help and info on the PageView please take a look at this help article

    Hope this helps, if you have any other questions or comments, please let me know,

    Best Regards,
    Emanuel Varga

    Telerik WinForms MVP
Back to Top