This is a migrated thread and some comments may be shown as answers.

Regarding Data Binding between RadScheduler and MySQL

13 Answers 249 Views
Scheduler and Reminder
This is a migrated thread and some comments may be shown as answers.
Phil
Top achievements
Rank 1
Phil asked on 31 Oct 2013, 08:58 AM
For data binding in winform scheduler, i want to update database when the appointment is added, updated rather than when some update button is clicked.

Currently, the documentations provided is perfectly describing how it work with button, and i love it. Nonetheless, i want to find better, and easy way to update appointment, so we can get rid of using update button.

Is there any event property for radscheduelr that i can use in this condition? or Any other way to do this?

13 Answers, 1 is accepted

Sort by
0
MasterChiefMasterChef
Top achievements
Rank 2
answered on 05 Nov 2013, 04:34 PM
Hi Daewoong,

There are properties on the RadScheduler that will force a data update. To quote Ivan Todorov from this thread:

"To reload the data from the database, you should use the Fill method of your table adapters to repopulate your datasets with data. When you do this, RadScheduler should automatically detect the changes and reflect them to the user interface. If this does not happen, then you can force an update by calling RadScheduler's DataBind method."

Let us know if this helps. Feel free to ask any further questions you may have about the RadScheduler or any other RadControls.

Regards,
Master Chief

0
Phil
Top achievements
Rank 1
answered on 05 Nov 2013, 04:49 PM
Well, I wrote bit jumbled up post, sorry for that.  I use data binding and it perfectly works when loading from database.

What i want to do is that updating database without clicking button when client add appointment or edit appointment or delete it or dragging appointments.

The documentations provides methods that works with button clicking after adding,editing deleting,dragging, or...(many other scheduler features) appointments. If i do not want to update database with button, i probably need to copy the codes for every event handling method, which is counter productive. So i am looking for any event properties in radscheduler that pops up when scheduler's appointment data is changed. Therefore, every time clients change data on scheduler, the program update database automatically without needs of client to click "update button".

Is there any features in radscheduler?

0
MasterChiefMasterChef
Top achievements
Rank 2
answered on 05 Nov 2013, 06:46 PM
Are you trying to update after a user creates / edits / deletes an appointment? There are events triggered after all of these actions are done client side. You can access the RadScheduler's DataBind method inside of the AppointmentAdded and AppointmentDeleted methods. An example of this is shown here:

private void radScheduler1_AppointmentAdded(object sender, Telerik.WinControls.UI.AppointmentAddedEventArgs e)
{
      radScheduler1.DataBind();
}

Hopefully this helps you update your RadScheduler after a user adds or removes appointments.

Regards,
Master Chief
0
Phil
Top achievements
Rank 1
answered on 06 Nov 2013, 02:15 AM
Yes, both of them perfectly work when you 'add' and 'delete' appointment, but it does not work when you dragging appointment or editing appointment. And i read all the properties and could not find related properties. Did i miss that property?
0
MasterChiefMasterChef
Top achievements
Rank 2
answered on 06 Nov 2013, 03:54 PM
There are AppointmentDropped and AppointmentMoved methods, but I cannot seem to find an event triggered when the appointment is edited.
0
Phil
Top achievements
Rank 1
answered on 07 Nov 2013, 04:01 PM
so do we need to use update button for updating database when client edit appointment?
0
Accepted
George
Telerik team
answered on 08 Nov 2013, 02:01 PM
Hi Dawoong,

Thank you for contacting us.

Since RadScheduler uses ObservableCollection to store its appointments and every appointment implements the INotifyPropertyChanged interface, every time a property in an Appointment changes the CollectionChanged/Changing events are being fired. You can use them to track edits on appointments:
void Appointments_CollectionChanged(object sender, NotifyCollectionChangedEventArgs e)
{
    if (e.Action == NotifyCollectionChangedAction.ItemChanged)
    {
        Appointment app = e.NewItems.Count > 0 ? e.NewItems[0] as Appointment : null;
        if (app != null)
        {
        }
    }
}

You can subscribe as follows:
this.scheduler.Appointments.CollectionChanged += Appointments_CollectionChanged;

I hope this helps.

PS. As this question concerns RadScheduler for WinForms, the thread was move to the WinForms forums.

Regards,
George
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WINFORMS.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
0
Snehith
Top achievements
Rank 1
answered on 18 Sep 2014, 06:11 AM
I am using custom appointment form. How can i bind the data from mysql to the radscheduler? How can i show appointment by resources?

Note: my appointment and resource table structure is different from the telerik.
  
0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 22 Sep 2014, 02:17 PM
Hello Snehith,

Thank you for writing.

I have prepared a sample project for your convenience demonstrating how to bind the RadScheduler, use custom EditAppointmentDialog (email property is included) and group by resources. The sample data base back up file is included as well. Our Data Binding Walkthrough help article covers the most usual scenario with binding to a database in which appointments and resources are in a many-to-many relation. 

If it is not suitable for your specific case and you have some specific data base structure, could you please provide some additional information about the exact appointments/resources tables's structure and their relation? Thus, we would be able to investigate the precise case and assist you further.

I hope this information helps. Should you have further questions, I would be glad to help.
 
Regards,
Desislava
Telerik
 
Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
 
0
Snehith
Top achievements
Rank 1
answered on 24 Sep 2014, 06:06 AM
Hello Desislava,

Thanks for reply.

I tried with your example and trying to understand and implement in my application.
Here i attach my appointment and resource tables and our custom appointment form.
We don't main any extra table for appointmentresource like in telerik, while inserting a record into the appointment table we have a column  resource. A single appointment can have multiple resources .
0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 26 Sep 2014, 12:13 PM
Hello Snehith,

Thank you for writing back.

You can refer to our Setting Appointment and Resource relations help article which is quite useful when you have only two tables for setting up data in scheduler. Please have a look at the attached sample project which demonstrates how to bind RadScheduler to a simpler data structure with two tables only. The back up file for the sample data base is included as well.

I hope this information helps. If you have any additional questions, please let me know.

Regards,
Desislava
Telerik
 
Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
 
0
Snehith
Top achievements
Rank 1
answered on 26 Sep 2014, 12:22 PM
Thanks Desislava,

I will try with your input and get back to you if i have any more issue.

0
Accepted
Dess | Tech Support Engineer, Principal
Telerik team
answered on 01 Oct 2014, 08:33 AM
Sure Snehith. Feel free to get back to us if you have any further questions.
 
Regards,
Desislava
Telerik
 
Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
 
Tags
Scheduler and Reminder
Asked by
Phil
Top achievements
Rank 1
Answers by
MasterChiefMasterChef
Top achievements
Rank 2
Phil
Top achievements
Rank 1
George
Telerik team
Snehith
Top achievements
Rank 1
Dess | Tech Support Engineer, Principal
Telerik team
Share this question
or