Back to Devexpress

SchedulerStorage.PrepareAppointmentFilterColumn Event

windowsforms-devexpress-dot-xtrascheduler-dot-schedulerstorage-3638f134.md

latest5.7 KB
Original Source

SchedulerStorage.PrepareAppointmentFilterColumn Event

Fires when a column, representing an appointment’s field, is added to the collection of filter columns contained within the FilterControl.

Namespace : DevExpress.XtraScheduler

Assembly : DevExpress.XtraScheduler.v25.2.dll

NuGet Package : DevExpress.Win.Scheduler

Declaration

csharp
public event PrepareFilterColumnEventHandler PrepareAppointmentFilterColumn
vb
Public Event PrepareAppointmentFilterColumn As PrepareFilterColumnEventHandler

Event Data

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

PropertyDescription
CancelGets or sets a value indicating whether the event should be canceled. Inherited from CancelEventArgs.
FilterColumnGets or sets a field to which a filter criteria is applied.

Remarks

Important

This API is intended to be used with the legacy SchedulerStorage only. Starting with version 18.1, SchedulerStorage and all of its satellite storages are replaced with their updated versions.

You can use the FilterControl to display only appointments that meet the specified conditions. To enable the control to filter appointments contained within the SchedulerStorage, the FilterControl.SourceControl property should be set to the SchedulerStorage.Appointments collection.

When the FilterControl begins creating a collection of columns which will be used to construct a logical expression (available via the FilterControl.FilterString property), the PrepareAppointmentFilterColumn event is raised for each added column. Handling this event enables you to substitute the column’s name with a custom text, or prepare a custom editor for specific value types. The column being added is available via the FilterColumn property of the event handler’s parameter.

The following code snippet illustrates the use of PrepareAppointmentFilterColumn event:

csharp
private void schedulerStorage1_PrepareAppointmentFilterColumn(object sender, 
    DevExpress.XtraScheduler.PrepareFilterColumnEventArgs e) 
{
    string fieldName = e.FilterColumn.FieldName;
    // Exclude the "AllDay" column.
    if(fieldName == "AllDay")
        e.Cancel = true;
    // Modify the caption for a column and provide a calculator control to edit values.
    if(fieldName == "CustomFieldMember") {
        e.FilterColumn.SetColumnCaption("Modified CustomFieldCaption");
        e.FilterColumn.SetColumnEditor(new 
            DevExpress.XtraEditors.Repository.RepositoryItemCalcEdit());
    }
}
vb
Private Sub schedulerStorage1_PrepareAppointmentFilterColumn(ByVal sender As Object, _
    ByVal e As DevExpress.XtraScheduler.PrepareFilterColumnEventArgs)

    Dim fieldName As String = e.FilterColumn.FieldName
    ' Exclude the "AllDay" column
    If fieldName = "AllDay" Then
        e.Cancel = True
    End If
    ' Modify the caption for a column and provide a calculator control to edit values
    If fieldName = "CustomFieldMember" Then
        e.FilterColumn.SetColumnCaption("Modified CustomFieldCaption")
        e.FilterColumn.SetColumnEditor(New _
            DevExpress.XtraEditors.Repository.RepositoryItemCalcEdit())
    End If
End Sub

Implements

PrepareAppointmentFilterColumn

See Also

PrepareResourceFilterColumn

SchedulerStorage Class

SchedulerStorage Members

DevExpress.XtraScheduler Namespace