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

LegendItemCreatingEventArgs Class

Provides data for the MapControl.LegendItemCreating event.

Namespace: DevExpress.XtraMap

Assembly: DevExpress.XtraMap.v24.2.dll

NuGet Package: DevExpress.Win.Map

#Declaration

public class LegendItemCreatingEventArgs :
    EventArgs,
    ILegendItemCreatingEventArgs

#Remarks

The LegendItemCreatingEventArgs class introduces the LegendItemCreatingEventArgs.Index and LegendItemCreatingEventArgs.Item properties that provide information about the legend item; and the LegendItemCreatingEventArgs.Legend property that provides access to the legend.

Note that LegendItemCreatingEventArgs objects are automatically created, initialized and passed to the corresponding event handlers.

#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);
}

#Inheritance

Object
EventArgs
LegendItemCreatingEventArgs
See Also