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

Selectedpage dont work

1 Answer 82 Views
PageView
This is a migrated thread and some comments may be shown as answers.
Shaggy
Top achievements
Rank 1
Shaggy asked on 10 Nov 2013, 01:11 PM
Hello,

i have following forms:

Dialogform: Is a form with a PageView - the Pageview have 2 Pages in it. Page A and Page B.

Mainform: From here i'm opening the Dialogform. There are 2 Buttons - on Click the button shows the Dialogform as a Dialog (modal).
  • Button A: On click i want to show the Dialogform. Page A should be shown.
  • Button B: On click i also want to show the Dialogform but Page B should be shown.

So when i'm starting my programm and i try the Buttons for the first time, everything works fine (with PageSelected).

But when i'm clicking first Button A, then closing the Diaglogform and press Button B, it still show's me Page A. The selected Tab is the right one - Tab B is marked, but it still shows me the content from Page A.
After that i need to switch manually in the Dialogform to Page A and then back to Page B, then it shows me the right Page.

Meanwhile i found a solution, but i dont know if this is the right one. I need to dispose the Dialogform on closing and then it works fine.

Is there any other solution for this issue?

Thanks.
Shaggy

1 Answer, 1 is accepted

Sort by
0
Dimitar
Telerik team
answered on 12 Nov 2013, 04:44 PM
Hi Shaggy,

Thank you for writing.

Another way to solve this is to change the selected page in the VisibleChanged event of the dialog form. Also you will need a custom ShowDialog method in order to determine which button is clicked. The attached project contains a sample implementation of the described approach.

I hope this helps. Should you have any other questions do not hesitate to ask.

Regards,
Dimitar
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WINFORMS.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
Tags
PageView
Asked by
Shaggy
Top achievements
Rank 1
Answers by
Dimitar
Telerik team
Share this question
or