SchedulerControl.AppointmentFlyoutShowing Event

Occurs before the appointment flyout is shown and allows you to substitute a flyout with another control.

Namespace: DevExpress.XtraScheduler

Assembly: DevExpress.XtraScheduler.v20.1.dll

Declaration

public event AppointmentFlyoutShowingEventHandler AppointmentFlyoutShowing
Public Event AppointmentFlyoutShowing As AppointmentFlyoutShowingEventHandler

Event Data

The AppointmentFlyoutShowing event's data class is AppointmentFlyoutShowingEventArgs. The following properties provide information specific to this event:

Property Description
Cancel Gets or sets whether the appointment flyout is not shown.
Control Allows you to set a control to display instead of default appointment flyout content.
FlyoutData Provides access to data displayed in the appointment flyout.

Remarks

The event arguments' AppointmentFlyoutShowingEventArgs.FlyoutData property contains data for display in a flyout or using a custom control.

Note that if you need to add interactive elements into a Flyout panel (buttons, editors, etc.), do not assign custom Flyout forms to the e.Control property. Instead, cancel the default Flyout and show a custom panel.

FlyoutPanel flyoutPanel = new FlyoutPanel();
XtraUserControl1 uc = new XtraUserControl1 { Dock = DockStyle.Fill };
//...
flyoutPanel.OwnerControl = schedulerControl1;
flyoutPanel.Size = uc.Size;
uc.Parent = flyoutPanel;
schedulerControl1.AppointmentFlyoutShowing += SchedulerControl_AppointmentFlyoutShowing;
//...
void SchedulerControl_AppointmentFlyoutShowing(object sender, AppointmentFlyoutShowingEventArgs e) {
    e.Cancel = true;
    flyoutPanel.ShowBeakForm(Cursor.Position);
}

Examples

This code snippet substitutes an appointment flyout with a custom label control, as illustrated below:

AppointmentFlyoutShowing

    scheduler.AppointmentFlyoutShowing += scheduler_AppointmentFlyoutShowing;

System.Windows.Forms.Label myControl;
public void scheduler_AppointmentFlyoutShowing(object sender, AppointmentFlyoutShowingEventArgs e) {
    if(myControl == null) {
        myControl = new System.Windows.Forms.Label();
        myControl.BackColor = Color.LightGreen;
        myControl.Size = new Size(200, 100);
        myControl.Font = new Font("Arial", 20);
    }
    myControl.Text = e.FlyoutData.Subject;
    e.Control = myControl;
}
See Also