Skip to content

DevExpress-Examples/winforms-scheduler-formatting-services

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

WinForms Scheduler - Formatting services

The WinForms scheduler control implements a set of services that make common tasks easier to implement (such as navigation, selection, formatting, keyboard and mouse event handling, etc.).

This example demonstrates formatting services:

private void checkButton1_CheckedChanged(object sender, EventArgs e) {
    if (checkButton1.Checked) {
        schedulerControl1.RemoveService(typeof(IAppointmentFormatStringService));
        schedulerControl1.AddService(typeof(IAppointmentFormatStringService), customAppointmentFormatStringService);
        schedulerControl1.RemoveService(typeof(ITimeRulerFormatStringService));
        schedulerControl1.AddService(typeof(ITimeRulerFormatStringService), customTimeRulerFormatStringService);
        schedulerControl1.RemoveService(typeof(IHeaderCaptionService));
        schedulerControl1.AddService(typeof(IHeaderCaptionService), customHeaderCaptionService);
        schedulerControl1.RemoveService(typeof(IHeaderToolTipService));
        schedulerControl1.AddService(typeof(IHeaderToolTipService), customHeaderToolTipService);
        schedulerControl1.ActiveView.LayoutChanged();
    }
    else {
        schedulerControl1.RemoveService(typeof(IAppointmentFormatStringService));
        schedulerControl1.AddService(typeof(IAppointmentFormatStringService), prevAppointmentFormatStringService);
        schedulerControl1.RemoveService(typeof(ITimeRulerFormatStringService));
        schedulerControl1.AddService(typeof(ITimeRulerFormatStringService), prevTimeRulerFormatStringService);
        schedulerControl1.RemoveService(typeof(IHeaderCaptionService));
        schedulerControl1.AddService(typeof(IHeaderCaptionService), prevHeaderCaptionService);
        schedulerControl1.RemoveService(typeof(IHeaderToolTipService));
        schedulerControl1.AddService(typeof(IHeaderToolTipService), prevHeaderToolTipService);
        schedulerControl1.ActiveView.LayoutChanged();
    }
}

Documentation