KG22

Selecting PageLayout Elements

Discussion created by KG22 on Sep 28, 2011
in my C# engine 10.0 application I have tools to allow users to add elements (north arrow, scale bar, scale text, text elements) to their page layout. My problem is that after adding them users are not able to select them using the 'Select Elements' tool included within engine.

For all but the text elements tool i have followed the esri sample which places these items with this line:

 m_HookHelper.ActiveView.GraphicsContainer.AddElement((IElement)mapSurroundFrame, 0);


I have found that if my user is in the map layout this call will error so i put a check in there to make sure active view supports IPageLayout.

For the text element i had to build that tool myself and it is very similar but the add line is:

m_HookHelper.ActiveView.GraphicsContainer.AddElement(element, 0);


where element is IElement from a TextElementClass.
That can be added to either the map or the layout. If i add it to the map then the 'Select Elements' tool will work with it. But not if it is on the Page layout view.

Is all of this by design? Is there a different tool for selecting elements from the layout view?

Outcomes