LegendItemCreatingEventArgs Class
Provides data for the MapControl.LegendItemCreating event.
Namespace: DevExpress.XtraMap
Assembly: DevExpress.XtraMap.v18.1.dll
Declaration
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.
Note
A complete sample project is available at https://github.com/DevExpress-Examples/how-to-configure-legenditem-objects-using-the-legenditemcreating-event-t142996
void map_LegendItemCreating(object sender, LegendItemCreatingEventArgs e) {
e.Item.Text = String.Format("{0}$", e.Item.Value);
}
Related GitHub Examples
The following code snippet (auto-collected from DevExpress Examples) contains a reference to the LegendItemCreatingEventArgs class.
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.