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

Resources accessible in AppointmentDataBound?

2 Answers 11 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
david
Top achievements
Rank 1
david asked on 10 Aug 2015, 03:08 PM

I added a couple of resources declaratively and the scheduler is nicely providing the dropdownlists and updating the DB.

I don't seem to be able to access the resource in the AppointmentDataBound, the GetResourceByType for my resource is never found?

 protected void RadScheduler1_AppointmentDataBound(object sender, SchedulerEventArgs e)
    {
        if (e.Appointment.Resources.GetResourceByType("APType") != null)
        {
            switch (e.Appointment.Resources.GetResourceByType("APType").Text)
            {

    case "Individual Session":
                    e.Appointment.CssClass = "rsCategoryYellow";
                    break;‚Äč

I wanted to use them to style the appointment like this:

  http://docs.telerik.com/devtools/aspnet-ajax/controls/scheduler/appearance-and-styling/setting-styles-for-appointments

 

2 Answers, 1 is accepted

Sort by
0
david
Top achievements
Rank 1
answered on 11 Aug 2015, 09:28 PM

Per this post I switched to the appointmentcreated event - http://www.telerik.com/forums/on-appointmentdatabound-resources-not-getting-load-in-radscheduler

 and still no joy, the resource is never found:

protected void RadScheduler1_AppointmentCreated(object sender, AppointmentCreatedEventArgs e)
    {
        if (e.Appointment.Resources.GetResourceByType("AppointmentTypes") != null)
        {
            switch (e.Appointment.Resources.GetResourceByType("AppointmentTypes").Text)
            {
                case "1": //"Individual Session"

 

here is the resource , which is rendering in the scheduler edit /insert form

 <ResourceTypes>
       
        <telerik:ResourceType DataSourceID="SqlDataSource3" ForeignKeyField="APTIDX" KeyField="APTIDX" Name="AppointmentTypes" TextField="AppointmentType" />
    </ResourceTypes>

0
david
Top achievements
Rank 1
answered on 11 Aug 2015, 09:44 PM

solved, the ascx & .cs were correct per my last post, problem was on the DB side - the foreign key from appointments-->appointmenttypes was not defined

 

Tags
Scheduler
Asked by
david
Top achievements
Rank 1
Answers by
david
Top achievements
Rank 1
Share this question
or