A newer version of this page is available. Switch to the current version.

ColorListLegend.SortOrder Property

Gets or sets the sort order of the color list legend items.

Namespace: DevExpress.XtraMap

Assembly: DevExpress.XtraMap.v19.2.dll


public LegendItemsSortOrder SortOrder { get; set; }
Public Property SortOrder As LegendItemsSortOrder

Property Value

Type Default Description


A LegendItemsSortOrder enumeration value, specifying

the color list items sort order.


using System;
using System.Drawing;
using System.Windows.Forms;
using DevExpress.XtraMap;

namespace ColorListLegend_SortOrder {
    public partial class Form1 : Form {
        ColorListLegend legend;

        public Form1() {

        private void Form1_Load(object sender, EventArgs e) {
            legend = new ColorListLegend() { Alignment = LegendAlignment.TopRight };
            legend.CustomItems.Add(new ColorLegendItem() { 
                Color = Color.Orange, 
                Text = "First color" 
            legend.CustomItems.Add(new ColorLegendItem() {
                Color = Color.LightGray,
                Text = "Second color"
            legend.CustomItems.Add(new ColorLegendItem() {
                Color = Color.Coral,
                Text = "Third color"

            lbSortOrder.DataSource = Enum.GetValues(typeof(LegendItemsSortOrder));

        private void lbSortOrder_SelectedIndexChanged(object sender, EventArgs e) {
            legend.SortOrder = (LegendItemsSortOrder)lbSortOrder.SelectedValue;
See Also