ESRI.ArcGIS.Mobile
SelectionMapAction Class
Members  Example  See Also  Send Feedback
ESRI.ArcGIS.Mobile.WinForms Namespace : SelectionMapAction Class

Allows you to select features on Map by a point, envelope, or polygon.

Object Model



Syntax

Visual Basic (Declaration) 
Public Class SelectionMapAction 
   Inherits MapAction
C# 
public class SelectionMapAction : MapAction 

Example

The example shows how to select features using selectionMapAction, and populate results in a datagrid control. refer to Selection sample for more details
C#Copy Code
// in the form design mode,  
// adds selectionGraphicLayer1 
// adds selectionMapAction1, sets its property selectionGraphicLayer to selectionGraphicLayer1 
   
private void Form1_Load(object sender, EventArgs e) 

  ... 
  // sets building layer as current selection layer 
  SelectionMapAction selectionMapAction1 =  new SelectionMapAction(); 
  string selLayerName = "building"; 
  FeatureSource fsource = m_mobilecache.FeatureSources[ selLayerName] as FeatureSource; 
  selectionMapAction1.SelectionFeatureSources.Clear(); 
  selectionMapAction1.SelectionFeatureSources.Add(fsource); 
  
  // sets current mapaction to selection 
  map1.MapAction = selectionMapAction1; 
  // selection by polygon 
  selectionMapAction1.SelectionType = SelectionType.Polygon; 
  ... 

 
void selectionMapAction1_StatusChanged(object sender, ESRI.ArcGIS.Mobile.WinForms.MapActionStatusChangedEventArgs e) 

  // cleans the previous result 
  dataGridView1.DataSource = null; 
 
  // gets the result 
  IList<FeatureDataTable> selectedDataTables = selectionMapAction1.SelectedFeatures; 
  if (selectedDataTables == null || selectedDataTables.Count == 0) 
     return; 
  // populates the result in the datagrid 
  FeatureDataTable ftable = selectionMapAction1.SelectedFeatures[0]; 
  dataGridView1.DataSource = ftable; 

  

Remarks

You can specify "selectable" layers by passing feature sources to the SelectionMapAction.SelectionFeatureSources property, and the GeometricRelationship determines what type of geometric relationship would be used. Upon the completion of SelectionMapAction, use SelectedFeatures property to get a list of FeatureDataTable each of which contains selected features belonging to that feature source.

Inheritance Hierarchy

System.Object
   ESRI.ArcGIS.Mobile.WinForms.MapAction
      ESRI.ArcGIS.Mobile.WinForms.SelectionMapAction

Requirements

Target Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, Windows Vista, Windows Server 2008 family

See Also

© 2013 All Rights Reserved.