Sunday, June 14, 2015

Binding ScheduleView to Database part 2: The best way

In the previous post, we saw how to bind ScheduleView control to database, using class that derived from Telerik.Windows.Controls.ScheduleView.Appointment class. This is a good way, but let's examine if this is also the best way.

If you try to add a new appointment [Doublic-click on ScheduleView control, edit, click OK. don't forget click also on Save button before closing the application, you will see that these properties are bound well to database:

  • Subject
  • Description [mapped to Body column]
  • Start
  • End
  • Importance.


However, Some properties are not mapped to database and not saved. If you try set them, you will see the changes, until you restart the application, then the changes will be lost. It is because of  those properties are Objects and not simple properties.

These are the properties that not implemented yet:

  • Category
  • TimeMarker
  • Recurrence
  • Resources


If you don't need them, you can use the previous post approach, and enjoy. But, If you want to exhaust the possibilities that ScheduleView control offers for you, it's better to leave the Appointment class, and implement ourselves the IAppointment interface. It is very easily, and it gives us a flexibility class, that we can customize and extending easily.

In the next post, we'll see the best approach: how to implement the IAppointment interface ourselves.

No comments:

Post a Comment