Skip to main content

LegendItemCreatingEventHandler Delegate

A method that will handle the MapControl.LegendItemCreating event.

Namespace: DevExpress.XtraMap

Assembly: DevExpress.XtraMap.v23.2.dll

NuGet Package: DevExpress.Win.Map


public delegate void LegendItemCreatingEventHandler(
    object sender,
    LegendItemCreatingEventArgs e


Name Type Description
sender Object

The event source.

e LegendItemCreatingEventArgs

A LegendItemCreatingEventArgs object that contains event data.


When creating a LegendItemCreatingEventHandler delegate, you identify the method that will handle the corresponding event. To associate an event with your event handler, add a delegate instance to this event. The event handler is called whenever the event occurs, unless you remove the delegate. For more information about event handler delegates, see Events and Delegates in MSDN.


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);
See Also