DxSchedulerAppointmentLabelMappings.ColorSavingType Property
Specifies the type of values in the data source field mapped to the Color property.
Namespace: DevExpress.Blazor
Assembly: DevExpress.Blazor.v22.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 |
OleColor | A data field mapped to the |
ArgbColor | A data field mapped to the |
ColorString | A data field mapped to the |
ColorInstance | A data field mapped to the |
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:
- integer ARG values
- OLE values
- string hexadecimal values
- System.Drawing.Color values
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; }
}
}