Set Appointment visibility on databinding

3 posts, 1 answers
  1. Navaneeth Kumar
    Navaneeth Kumar avatar
    9 posts
    Member since:
    Feb 2010

    Posted 19 Mar 2013 Link to this post

    Hi,

    I am using a Rad scheduler and I'm binding a generic list to the Rad Scheduler. Everything works fine. But I want to set the visibility property of each appointment from the visibility property of the corresponding item in the list. How can I achieve this?

    Regards,
    Navaneeth
  2. Answer
    Plamen
    Admin
    Plamen avatar
    3080 posts

    Posted 19 Mar 2013 Link to this post

    Hello,

     
    We commend setting the visibility in the AppointmentDataBound event. Here is a sample code that worked properly for resources with Key equal to 1 that I added to our on-line demo and worked properly:

    protected void RadScheduler1_AppointmentDataBound(object sender, SchedulerEventArgs e)
           {
              
               if (e.Appointment.Resources.GetResourceByType("User").Key.ToString()=="1")
               {
                   e.Appointment.Visible = false;
               }
           }

    Hope this will be helpful.

    Greetings,
    Plamen
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
  3. Navaneeth Kumar
    Navaneeth Kumar avatar
    9 posts
    Member since:
    Feb 2010

    Posted 19 Mar 2013 Link to this post

    Hi Plamen,

    Thanks for your reply. AppointmentDataBound was the event I was looking for.

    In my case, I was binding list<myowntype> to the radscheduler. So to set the visibility of the appointment, I did the following

    protected void RadScheduler1_AppointmentDataBound(object sender, SchedulerEventArgs e)
            {
    if
    (((myowntype)(e.Appointment.DataItem)).Visibility == false)
                {
                    e.Appointment.Visible = false;
                }
    }

    Regards,
    Navaneeth
Back to Top