All docs
V21.1
21.2 (EAP/Beta)
21.1
20.2
20.1
19.2
The page you are viewing does not exist in version 19.2. This link will take you to the root page.
19.1
The page you are viewing does not exist in version 19.1. This link will take you to the root page.
18.2
The page you are viewing does not exist in version 18.2. This link will take you to the root page.
18.1
The page you are viewing does not exist in version 18.1. This link will take you to the root page.
17.2
The page you are viewing does not exist in version 17.2. This link will take you to the root page.

MapItem.EnableSelection Property

Indicates whether a map item can be selected.

Namespace: DevExpress.XtraMap

Assembly: DevExpress.XtraMap.v21.1.dll

Declaration

[DefaultValue(DefaultBoolean.Default)]
public DefaultBoolean EnableSelection { get; set; }

Property Value

Type Default Description
DefaultBoolean

Default

true if a map item can be selected; otherwise, false.

Available values:

Name Description
True

Corresponds to a Boolean value of true.

False

Corresponds to a Boolean value of false.

Default

The default behavior determined by the control’s logic.

Remarks

The MapItem.EnableSelection property has a higher priority than the MapItemsLayerBase.EnableSelection property specified for the map layer that contains the map item.

The following example disables selection for all items on the itemsLayer except the MapEllipse item:

private void Form1_Load(object sender, EventArgs e) {
    //...
    // Create a layer to display vector items.
    VectorItemsLayer itemsLayer = new VectorItemsLayer();
    itemsLayer.EnableSelection = false;
    map.Layers.Add(itemsLayer);

    // Create storage for map items and generate them.
    MapItemStorage storage = new MapItemStorage();
    MapItem[] myItems = GetMapItems();
    storage.Items.AddRange(myItems);
    itemsLayer.Data = storage;
}

// Create an array of map items.
MapItem[] GetMapItems() {
    return new MapItem[] {
        new MapDot() { Location = new GeoPoint(55, 0), Size=30},
        new MapEllipse() { Location = new GeoPoint(40, 12),  Width = 2000, Height = 1000, 
                           EnableSelection = DefaultBoolean.True },
        new MapRectangle() {  Location = new GeoPoint(60, 13), Width = 1500, Height = 1000 }
    };
}
See Also