ArcGIS Pro 3.4 API Reference Guide
ArcGIS.Desktop.Layouts Namespace / MapSeries Class / FindPageNumber Method
Example Version

FindPageNumber Method
Returns a map series page number based on the name field value of the index feature.
Syntax
public string FindPageNumber( 
   string pageName
)

Parameters

pageName
Remarks
Setting the current page requires specifying the approproriate page numnber. This helper function returns the page number associated with a page name.
Example
MapSeries_FindPageNumber
//Return the page number that corresponds to the page name field for an index feature

Layout layout = LayoutView.Active.Layout;

//Perform on the worker thread
await QueuedTask.Run(() =>
{
  SpatialMapSeries SMS = layout.MapSeries as SpatialMapSeries;
  Row msRow = SMS.CurrentRow;
  System.Windows.MessageBox.Show(SMS.FindPageNumber(msRow.GetOriginalValue(msRow.FindField("NAME")).ToString()));
});
Requirements

Target Platforms: Windows 11, Windows 10

ArcGIS Pro version: 3 or higher.
See Also