MessageBox for RadPageView_selectedpagechanged

2 posts, 0 answers
  1. Raj
    Raj avatar
    3 posts
    Member since:
    May 2013

    Posted 17 May 2013 Link to this post

              Hello There,
                        My question is some what different.I two RadPageView and on First RadPageView's  LinkClickLabel i generate the second RadPageView,So after text generated into my second RadPageView TextBoxes,when i change the page(selectedpagechanged or chaging) of first RadPageView,I want to Generate MessageBox like to save changes or not.I have done some what of it.but actually i am getting messagebox multiple times as much as the First RadpageView Contains Pages.

    My code Is Like this:
    for example:

       private void MyPagePageView_SelectedPageChanging(object sender, RadPageViewCancelEventArgs e)
                RadPageViewPage selectedpageMyPage = MyPagePageView.SelectedPage;
                Control[] Mypagetext = selectedpageMyPage.Controls.Find("richtextbox", false);
                 if (Mypagetext != null)
                    RadPageViewPage selectedpageMySecondPage = MySecondPagePageView.SelectedPage;
                    Control[] Txt1Text = selectedpageMySecondPage.Controls.Find("Txt1", false);
                    Control[] Txt2Text = selectedpageMySecondPagePage.Controls.Find("Txt2", false);
                    Control[] Txt3Text = selectedpageMySecondPagePage.Controls.Find("Txt3", false);
                    Control[] Txt4Text = selectedpageMySecondPage.Controls.Find("Txt4", false);
                    Control[] Txt5Text = selectedpageMySecondPage.Controls.Find("Txt5", false);
                    if (Txt1Text != null)
                        if (Txt2Text != null)
                            if (Txt3Text != null)
                                if (Txt4Text != null)
                                    if (Txt5Text != null)
                                        RadTextBox tb = new RadTextBox();
                                        if (tb is RadTextBox)
                                            DialogResult dialogresult = MessageBox.Show("Do you want to save changes","DB",MessageBoxButtons.YesNo);

                                            if (dialogresult == DialogResult.Yes)

                                                MessageBox.Show("To save changes Click the SAVE button");

                                            else if (dialogresult == DialogResult.No)


    Thank you,
    Niranjan Patil 

  2. Peter
    Peter avatar
    1157 posts

    Posted 21 May 2013 Link to this post

    Hello Raj,

    Thank you for writing.

    I am not sure that I understand your request. In case that you want to prevent changing the current page, you should set the e.Cancel property to true, instead of setting the DialogResult. Please, refer to my sample project that demonstrates this approach.

    I hope this helps.

    Kind regards,
    the Telerik team
    RadChart for WinForms is obsolete. Now what?
Back to Top