This is a migrated thread and some comments may be shown as answers.

MessageBox for RadPageView_selectedpagechanged

1 Answer 161 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Raj
Top achievements
Rank 1
Raj asked on 17 May 2013, 07:53 AM
Hello,
          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 


1 Answer, 1 is accepted

Sort by
0
Peter
Telerik team
answered on 21 May 2013, 05:54 PM
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,
Peter
the Telerik team
RadChart for WinForms is obsolete. Now what?
Tags
General Discussions
Asked by
Raj
Top achievements
Rank 1
Answers by
Peter
Telerik team
Share this question
or