ESRI.ArcGIS.Mobile
SelectionMapAction Class
Members  Example  See Also  Send Feedback
ESRI.ArcGIS.Mobile.MapActions 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. refers to RubberBandSelection 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 
        string selLayerName = "building"; 
        FeatureLayer flayer = mobileCache1.Layers[selLayerName] as FeatureLayer 
        selectionMapAction1.SelectionLayers.Clear(); 
        selectionMapAction1.SelectionLayers.Add(flayer); 
       
         // sets current mapaction to selection 
        map1.CurrentMapAction = selectionMapAction1; 
        // selection by polygon 
         selectionMapAction1.SelectionType = SelectionType.Polygon; 
      
        ... 
    } 
      
    void selectionMapAction1_StatusChanged(object sender, ESRI.ArcGIS.Mobile.MapActions.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 layers to the SelectionMapAction.SelectionLayers property, and the GeometricRelationship determines what type of geometric relationship would be used. Upon the completion of SelectionMapAction, use GetFeatureSelection() method to get a list of FeatureDataTable each of which contains selected features belonging to that feature layer.

Inheritance Hierarchy

System.Object
   System.MarshalByRefObject
      System.ComponentModel.Component
         ESRI.ArcGIS.Mobile.MapActions.MapAction
            ESRI.ArcGIS.Mobile.MapActions.SelectionMapAction

Requirements

Namespace: ESRI.ArcGIS.Mobile.MapActions

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

Assembly: ESRI.ArcGIS.Mobile (in ESRI.ArcGIS.Mobile.dll)

See Also