Skip to main content
A newer version of this page is available. .

MapControl.LegendItemCreating Event

Occurs when items are being created for the legend.

Namespace: DevExpress.XtraMap

Assembly: DevExpress.XtraMap.v19.2.dll

Declaration

public event LegendItemCreatingEventHandler LegendItemCreating

Event Data

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

Property Description
Index Returns the index of the legend item being created.
Item Returns the legend item being created.
Legend Provides access to the legend for which a new item has been created.

Example

To manually customize legend items, implement the MapControl.LegendItemCreating event handler, where you can configure MapLegendItemBase descendant class objects as you wish.

The following instance demonstrates how to do this.

void map_LegendItemCreating(object sender, LegendItemCreatingEventArgs e) {
    e.Item.Text = String.Format("{0}$", e.Item.Value);
}

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the LegendItemCreating event.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

See Also