DxSchedulerResourceMappings.ColorSavingType Property

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

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v20.2.dll

Declaration

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

Property Value

Type Default Description
ColorSavingType

Auto

The type of color values in the data source field.

Remarks

When the ColorSavingType property is set to Auto, the Scheduler automatically recognizes the format of the color value. The data source field mapped to the Color property can store colors in any of the following 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 resource.

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.
        // ...
        ResourcesSource = new List<ResourceObject>() {
                new ResourceObject() { Id = "1", ResourceName = "Resource One", ResourceColor = "0xFFFF0000" },
                new ResourceObject() { Id = "2", ResourceName = "Resource Two", ResourceColor = "0xFF0000FF" },
            },
        ResourceMappings = new DxSchedulerResourceMappings() {
            Id = "Id",
            Caption = "ResourceName",
            Color = "ResourceColor",
            ColorSavingType = DevExpress.Blazor.ColorSavingType.ColorString
        }
    };

    public class ResourceObject {
        public int Id { get; set; }
        public string ResourceName { get; set; }
        public string ResourceColor { get; set; }
    }
}
See Also