Articles in this section
Category / Section

How to get the details of the selected appointment in WinForms ScheduleControl?

1 min read

Retrieve the selected appointment details

The selected appointment from ScheduleControl can be retrieved by using the SelectedAppointments property of ScheduleGrid as shown in the following code example.

C#

private void getSelectedAppointmentsBtn_Click(object sender, EventArgs e)
{
    foreach (IScheduleAppointment appointment in this.scheduleControl1.GetScheduleHost().SelectedAppointments)
    {
        MessageBox.Show("Appointment Date is " + appointment.StartTime.ToLongDateString() +
                "\n" + "Start Time is " + appointment.StartTime.ToLongTimeString() +
                "\n" + "End Time is " + appointment.EndTime.ToLongTimeString() +
                "\n" + "Subject is " + appointment.Subject.ToString() +
                "\n" + "Location is " + appointment.LocationValue.ToString());
    }
}

VB

Private Sub getSelectedAppointmentsBtn_Click(ByVal sender As Object, ByVal e As EventArgs) Handles getSelectedAppointmentsBtn.Click
    For Each appointment As IScheduleAppointment In Me.scheduleControl1.GetScheduleHost().SelectedAppointments
        MessageBox.Show("Appointment Date is " & appointment.StartTime.ToLongDateString() + Constants.vbLf & "Start Time is " & appointment.StartTime.ToLongTimeString() + Constants.vbLf & "End Time is " & appointment.EndTime.ToLongTimeString() + Constants.vbLf & "Subject is " & appointment.Subject.ToString() & Constants.vbLf & "Location is " & appointment.LocationValue.ToString())
    Next appointment
End Sub

 

Note:

The Syncfusion.Grid.Windows.dll has to be added in your application to access the “SelectedAppointments” property.

Screenshot:

Show the selected appointment details

Figure 1: SelectedAppointments

Samples:

C#: Selected_Appointments_CS

VB: Selected_Appointments_VB

Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments (0)
Please sign in to leave a comment
Access denied
Access denied