WinForms - Scheduler - Sort And Group Appointments (v19.1)

WinForms Team Blog
15 May 2019

The DevExpress WinForms Scheduler Control now provides two events that allow you to sort and group appointments: CustomAppointmentGroup and CustomAppointmentSort. Both events are demonstrated in our Scheduler Demos, when you use the Group by Category and Sort by Category checkboxes in the right-hand options panel.

The event CustomAppointmentSort is similar to custom sort events in our Data Grid: it applies a three-way comparison to a pair of appointments. You need to write a simple piece of code to set e.Result:

  • Set e.Result to a negative value if the appointment related to the e.AppointmentLayoutInfo1 parameter should appear first
  • Set e.Result to a positive value if the appointment related to the e.AppointmentLayoutInfo2 parameter should appear first
  • Set e.Result to 0 if both appointments are considered equal and the Scheduler should utilize its default sort algorithm to arrange them

This screenshot from the DevExpress demos illustrates an example: appointments with the Out of Office status (the green appointment items in the image) are placed after appointments without assigned status.

Custom Sort

The event CustomAppointmentGroup event helps you build groups that are visually separate in the Scheduler Control. In our demos, the property e.GroupKey (an integer value used as a group index) is set according to appointment labels.

Custom Group

You can combine custom group and sort events to break down appointments into groups, and then sort each group individually.

Let’s Hear Your Feedback

If you have any comments on the new functionality, or ideas for additional extensions, please let us know. Feel free to comment below or open Support Center tickets for further discussion.

Free DevExpress Products - Get Your Copy Today

The following free DevExpress product offers remain available. Should you have any questions about the free offers below, please submit a ticket via the DevExpress Support Center at your convenience. We'll be happy to follow-up.
No Comments

Please login or register to post comments.