How to get appointment details in WinForms ScheduleControl?
Retrieve the selected appointment details
The selected appointment from WinForms 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
The Syncfusion.Grid.Windows.dll has to be added in your application to access the “SelectedAppointments” property.
Screenshot:
Figure 1: SelectedAppointments
Samples:
Conclusion
I hope you enjoyed learning about how to get appointment details in WinForms ScheduleControl
You can refer to our WinForms ScheduleControl feature tour page to know about its other groundbreaking feature representations and documentation, to understand how to create and manipulate data.
For current customers, you can check out our components from the License and Downloads page. If you are new to Syncfusion, you can try our 30-day free trial to check out our other controls.
If you have any queries or require clarifications, please let us know in the comments section below. You can also contact us through our support forums, Direct-Trac, or feedback portal. We are always happy to assist you!