Skip to main content

AppointmentMappingInfo.ResourceId Property

Gets or sets the data field to which the Appointment.ResourceId or the Appointment.ResourceIds property is bound.

Namespace: DevExpress.XtraScheduler

Assembly: DevExpress.XtraScheduler.v24.2.Core.dll

Declaration

[DefaultValue("")]
public virtual string ResourceId { get; set; }

Property Value

Type Default Description
String String.Empty

A String value that specifies the name of the bound data field.

Remarks

Use the ResourceId property to bind an appointment’s Appointment.ResourceId or Appointment.ResourceIdsproperty to a data field in the external data source. The data source is specified by the PersistentObjectStorage<T>.DataSource property of the AppointmentStorage.

Note

If SchedulerControl.ResourceSharing is enabled, mapped data field should be a text field of sufficient length; otherwise map it to the field of any type but make sure that the type of the Resource ID field is the same in Appointments and Resources tables.

If resources are shared (the SchedulerControl.ResourceSharing option is true in a data-bound mode, or several resource identifiers are added to the Appointment.ResourceIds collection), the mapped data field contains a string in XML format. Since resource identifiers are objects, they are base-64 encoded.

The following string is the content of a data field mapped with the ResourceId mapping if Resources is switched on. An appointment is associated with resources having identifiers 1,2 and 3.

<ResourceIds>
<ResourceId Value="~Xtra#Base64AAEAAAD/////AQAAAAAAAAAEAQAAAAxTeXN0ZW0uSW50MzIBAAAAB21fdmFsdWUACAIAAAAL" />
<ResourceId Value="~Xtra#Base64AAEAAAD/////AQAAAAAAAAAEAQAAAAxTeXN0ZW0uSW50MzIBAAAAB21fdmFsdWUACAEAAAAL" />
<ResourceId Value="~Xtra#Base64AAEAAAD/////AQAAAAAAAAAEAQAAAAxTeXN0ZW0uSW50MzIBAAAAB21fdmFsdWUACAMAAAAL" />
</ResourceIds>

Set the SchedulerCompatibility.Base64XmlObjectSerialization to false to stop base64 serialization. In this situation the stored XML string changes as follows:

<ResourceIds>
<ResourceId Type="System.Int32" Value="2" />
<ResourceId Type="System.Int32" Value="1" />
<ResourceId Type="System.Int32" Value="3" />
</ResourceIds>

The following code snippets (auto-collected from DevExpress Examples) contain references to the ResourceId property.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

See Also