This example illustrates how to bind a Scheduler extension to the XPO datasource. As a starting point, we are using the Scheduler in the partial view (see the Note section in the Using Callbacks help article). We use the SchedulerHelper class to initialize Scheduler settings for both view and controller. This allows us to implement a reliable solution according to the Lesson 3 - Use Scheduler in Complex Views. This is preferable implementation, which should operate correctly in any possible scenarios.
As for data managing, we use an XPO-enabled controller from the How to use XPO in an ASP.NET MVC application KB article (see Approach #2 in this article):
[C#]publicclassHomeController:BaseXpoController<XPAppointment>{...}
The UpdateAppointment() method in this controller delegates handling to the base Save() and Delete() methods of the BaseXpoController<T>. You can compare this implementation with the non-XPO version illustrated in the Lesson 2 - Implement Insert-Update-Delete Appointment Functionality article. The actual data binding occurs at the view level:
[C#]@Html.DevExpress().Scheduler(Html.CreateSchedulerSettings()).Bind(Model.Appointments,Model.Resources).GetHtml()
The database connection string is adjusted in the context of the XpoHelperclass. Note that it is not necessary to create a database on your SQL Server instance beforehand because it will be created automatically by XPO according to the used models schema. These models are represented by the XPAppointment and XPResourceclasses. They are taken from the How to bind ASPxScheduler with multi-resource appointments to XPO via the Unit of Work code example.