Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Scheduling AppointmentForm (Read 2956 times)
fractal07
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 28
Location: France
Joined: Mar 13th, 2017
Scheduling AppointmentForm
May 12th, 2017 at 8:15am
Print Post  
Hello,
I'm trying to build my own Appointment Form with specifics components and, may be could you enlight me about the AppointmentForm Class.
In the AdvancedItemDrawing sample, the code to update an appointment is clear and pretty short:
Code
Select All
private void calendar_ItemClick(object sender, ItemMouseEventArgs e)
{
    if (e.Clicks == 2 && e.Button == MouseButtons.Left)
    {
	calendar.ResetDrag();
	AppointmentForm form = new AppointmentForm(calendar.Schedule);
	form.SetAppointment(e.Item as Appointment);
	form.ShowDialog(this);
    }
}
 


... but it's kind of a magic! How the modifications done in the dialog form are stored and update the clicked appointment? And, by the way, how could I update an existing appointment?
Kind regards
  
Back to top
 
IP Logged
 
Meppy
God Member
*****
Offline


MindFusion support

Posts: 1783
Joined: Jul 20th, 2005
Re: Scheduling AppointmentForm
Reply #1 - May 12th, 2017 at 8:55am
Print Post  
Hi,

The changes to the item (specified by AppointmentForm.SetAppointment) are automatically applied by the form when the user clicks the 'Save and Close' button. The form traverses all controls and sets their values to the respective item properties. For example, the TextBox containing the header text of the item is called _tbSubject. When the user saves the changes, the form does something like this:

Code
Select All
if (app.Subject != _tbSubject.Text)
	app.Subject = _tbSubject.Text; 


Where app is the edited appointment.

Regards,
Meppy
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint