Back to Devexpress

AppointmentMappingInfo.EndConverter Property

corelibraries-devexpress-dot-xtrascheduler-dot-appointmentmappinginfo-8cede18d.md

latest4.6 KB
Original Source

AppointmentMappingInfo.EndConverter Property

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

Namespace : DevExpress.XtraScheduler

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

NuGet Package : DevExpress.Scheduler.Core

Declaration

csharp
[Browsable(false)]
public ISchedulerMappingConverter EndConverter { get; set; }
vb
<Browsable(False)>
Public Property EndConverter 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 MappingConverterEnd : 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) {
        string s = ((DateTime)obj).ToString("s");
        return s;
    }
}
vb
Friend Class MappingConverterEnd
    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
        Dim s As String = DirectCast(obj, Date).ToString("s")
        Return s
    End Function
End Class

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

csharp
schedulerStorage1.Appointments.Mappings.StartConversionBehavior = MappingConversionBehavior.InPlaceOfMapping;
schedulerStorage1.Appointments.Mappings.EndConverter = new MappingConverterEnd();
schedulerStorage1.Appointments.Mappings.EndConversionBehavior = MappingConversionBehavior.InPlaceOfMapping;

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

vb
schedulerStorage1.Appointments.Mappings.StartConversionBehavior = MappingConversionBehavior.InPlaceOfMapping
schedulerStorage1.Appointments.Mappings.EndConverter = New MappingConverterEnd()
schedulerStorage1.Appointments.Mappings.EndConversionBehavior = MappingConversionBehavior.InPlaceOfMapping

See Also

Appointment

AppointmentMappingInfo Class

AppointmentMappingInfo Members

DevExpress.XtraScheduler Namespace