How to Programmatically Determine Current Page Being Designed
I am working with a DesignerControl control and want to programatically make some change to the report design of the page the user is viewing/editing in the designer control.
I can make the changes to a hard-coded page, like the first page in the report, just fine. But I want to determine which page is the currently edited page and make the changes to that page. How do I do that?
I could not find a suitable property on the designer control. I then tried looking at the report itself and I found.
Report.Pages.OfType<ReportPage>().FirstOrDefault(x => x.IsSelected);
This works sometimes, but not always. I don't why but sometimes there are no pages that are IsSelected==true. I can't find any documentation for IsSelected so maybe its not appropriate. I just took a stab at it.
How can I determine which report page is currently being viewed in the designer?
thanks