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

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.