Resources accessible in AppointmentDataBound?

3 posts, 0 answers
  1. david
    david avatar
    210 posts
    Member since:
    May 2007

    Posted 10 Aug 2015 Link to this post

    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. david
    david avatar
    210 posts
    Member since:
    May 2007

    Posted 11 Aug 2015 in reply to david Link to this post

    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>

  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. david
    david avatar
    210 posts
    Member since:
    May 2007

    Posted 11 Aug 2015 in reply to david Link to this post

    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

     

Back to Top