DxSchedulerResourceMappings.ColorSavingType Property
Specifies the type of values in the data source field mapped to the Color property.
Namespace: DevExpress.Blazor
Assembly: DevExpress.Blazor.v24.1.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 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:
- integer ARG values
- OLE values
- string hexadecimal values
- 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 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; }
}
}