ESRI.ArcGIS.ADF.IMS
Filter Property
See Also  Example
ESRI.ArcGIS.ADF.IMS.Carto.Layer Namespace > FeatureLayer Class : Filter Property




Gets or sets the Filter.

Syntax

Visual Basic (Declaration) 
Public Property Filter As Filter
Visual Basic (Usage)Copy Code
Dim instance As FeatureLayer
Dim value As Filter
 
instance.Filter = value
 
value = instance.Filter
C# 
public Filter Filter {get; set;}

Example

This example creates a filter with an attribute query, and adds the filter to a map layer.
C#Copy Code
Filter filter = new Filter(); 

filter.WhereExpression = "POPULATION > 100000"; 

myLayer.Filter = filter; 

    
Visual BasicCopy Code
Dim filter As New Filter

filter.WhereExpression = "POPULATION > 100000"

myLayer.Filter = filter

Remarks

This property causes a subset of the layer to be displayed in a map image request. This property does not affect any queries performed on the layer, such as with Query or Identify.

If used with a pre-existing map layer, the filter will cause a subset of the layer to display on the map. If you want to display the existing layer but add a highlight to certain features, use one of the CreateSelectionLayer methods and add the selection layer to the map. Alternatively, create a copy of the layer with Clone or FeatureLayer(FeatureLayer), then set the filter on the copy, and add the copy to the map's layers.

If no features match the filter criteria, the layer will not be displayed in the map.

See Also

© 2010 All Rights Reserved.