Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

MapEditor.MapItemEditing Event

Occurs when a user stars to edit a map item.

Namespace: DevExpress.XtraMap

Assembly: DevExpress.XtraMap.v24.2.dll

NuGet Package: DevExpress.Win.Map

#Declaration

[Browsable(false)]
public event MapItemEditingEventHandler MapItemEditing

#Event Data

The MapItemEditing event's data class is MapItemEditingEventArgs. The following properties provide information specific to this event:

Property Description
Action Returns the action applied to items.
AdditionalInfo Returns additional information about edited items.
EditMode Returns the map edit mode.
Items Returns the items to be displayed on a map.
Result Gets or sets the edit action result.

#Remarks

The following code shows how to complete the item (a path or a polyline) creation in the Map Editor’s Create mode once the number of vertices reaches 10.

mapControl.MapEditor.MapItemEditing += OnMapItemEditing;
// . . . 
private void OnMapItemEditing(object sender, MapItemEditingEventArgs e) {
    if (e.EditMode == MapEditMode.Create) {
        EditableItemHitInfo info = (EditableItemHitInfo)e.AdditionalInfo;
        if (info.Item is MapPath && info.Item.GetContours()[0].Points.Count + 1 > 10)
            e.Result = MapEditActionResult.Finish;
    }
}
See Also