)
We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

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

Platform: WinForms |
Control: ScheduleControl |
Published Date: July 29, 2015 |
Last Revised Date: January 10, 2020
Tags: appointment

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

2X faster development

The ultimate WinForms UI toolkit to boost your development speed.
ADD COMMENT
You must log in to leave a comment

Please sign in to access our KB

This page will automatically be redirected to the sign-in page in 10 seconds.

Up arrow icon

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon