Skip to main content

DxSchedulerAppointmentLabelMappings.ColorSavingType Property

Specifies the type of values in the data source field mapped to the Color property.

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v23.2.dll

NuGet Package: DevExpress.Blazor

Declaration

[DefaultValue(ColorSavingType.Auto)]
public ColorSavingType ColorSavingType { get; set; }

Property Value

Type Default Description
ColorSavingType Auto

A ColorSavingType enumeration value.

Available values:

Name Description
Auto

A data field mapped to the Color property can store values of any supported type. The correct value type is determined automatically.

OleColor

A data field mapped to the Color property should store values in OLE format.

ArgbColor

A data field mapped to the Color property should store 32-bit ARGB values (integer values in the “AARRGGBB” format).

ColorString

A data field mapped to the Color property should store string values that specify colors in the hexadecimal format.

ColorInstance

A data field mapped to the Color property should store values of the System.Drawing.Color type.

Remarks

When the ColorSavingType property is set to Auto (the default value), the Scheduler recognizes the type of color values automatically. The data source field mapped to the Color property can store colors in any of the supported formats:

To recognize values of one type only, set the ColorSavingType property to the corresponding value. If a field value is specified in another format, the color is not applied to the label.

The following example sets the ColorSavingType property to ColorString and defines colors as string hexadecimal values.

@code {
    DxSchedulerDataStorage DataStorage = new DxSchedulerDataStorage() {
        // Specify appointment mappings here.
        // ...
        AppointmentLabelsSource = new List<LabelObject>() {
                new LabelObject() { Id = "1", LabelName = "Label One", LabelColor = "0xFFFF0000" },
                new LabelObject() { Id = "2", LabelName = "Label Two", LabelColor = "0xFF0000FF" },
            },
        AppointmentLabelMappings = new DxSchedulerAppointmentLabelMappings() {
            Id = "Id",
            Caption = "LabelName",
            Color = "LabelColor",
            ColorSavingType = DevExpress.Blazor.ColorSavingType.ColorString
        }
    };

    public class LabelObject {
        public int Id { get; set; }
        public string LabelName { get; set; }
        public string LabelColor { get; set; }
    }
}
See Also