Back to Devexpress

AppointmentMappingInfo.StartConverter Property

corelibraries-devexpress-dot-xtrascheduler-dot-appointmentmappinginfo-89eceb8c.md

latest4.6 KB
Original Source

AppointmentMappingInfo.StartConverter Property

Gets or sets a value converter for the Appointment.Start property.

Namespace : DevExpress.XtraScheduler

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

NuGet Package : DevExpress.Scheduler.Core

Declaration

csharp
[Browsable(false)]
public ISchedulerMappingConverter StartConverter { get; set; }
vb
<Browsable(False)>
Public Property StartConverter As ISchedulerMappingConverter

Property Value

TypeDescription
ISchedulerMappingConverter

An object that implements the ISchedulerMappingConverter interface to translate the data between the property and the data source field.

|

Example

Note

A complete sample project is available at https://github.com/DevExpress-Examples/winforms-scheduler-mapping-converters

csharp
class MappingConverterStart : ISchedulerMappingConverter {
    public object Convert(object obj, Type targetType, object parameter) {
        return DateTime.ParseExact(obj.ToString(), "s", System.Globalization.DateTimeFormatInfo.InvariantInfo);
    }

    public object ConvertBack(object obj, Type targetType, object parameter) {
        return ((DateTime)obj).ToString("s");
    }
}
vb
Friend Class MappingConverterStart
    Implements ISchedulerMappingConverter

    Public Function Convert(ByVal obj As Object, ByVal targetType As Type, ByVal parameter As Object) As Object Implements ISchedulerMappingConverter.Convert
        Return Date.ParseExact(obj.ToString(), "s", System.Globalization.DateTimeFormatInfo.InvariantInfo)
    End Function

    Public Function ConvertBack(ByVal obj As Object, ByVal targetType As Type, ByVal parameter As Object) As Object Implements ISchedulerMappingConverter.ConvertBack
        Return DirectCast(obj, Date).ToString("s")
    End Function
End Class

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the StartConverter 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.

winforms-scheduler-mapping-converters/CS/SchedulerMappingConverterExample/Form1.cs#L71

csharp
schedulerStorage1.Appointments.Mappings.ReminderInfoConversionBehavior = MappingConversionBehavior.BetweenMappingAndProperty;
schedulerStorage1.Appointments.Mappings.StartConverter = new MappingConverterStart();
schedulerStorage1.Appointments.Mappings.StartConversionBehavior = MappingConversionBehavior.InPlaceOfMapping;

winforms-scheduler-mapping-converters/VB/SchedulerMappingConverterExample/Form1.vb#L73

vb
schedulerStorage1.Appointments.Mappings.ReminderInfoConversionBehavior = MappingConversionBehavior.BetweenMappingAndProperty
schedulerStorage1.Appointments.Mappings.StartConverter = New MappingConverterStart()
schedulerStorage1.Appointments.Mappings.StartConversionBehavior = MappingConversionBehavior.InPlaceOfMapping

See Also

Appointment

AppointmentMappingInfo Class

AppointmentMappingInfo Members

DevExpress.XtraScheduler Namespace