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
NuGet Package: DevExpress.Blazor
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. |
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 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
- 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 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; }
}
}