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

[Solved] Set Appointment visibility on databinding

2 Answers 88 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Navaneeth Kumar
Top achievements
Rank 1
Navaneeth Kumar asked on 19 Mar 2013, 09:43 AM
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 Answers, 1 is accepted

Sort by
0
Accepted
Plamen
Telerik team
answered on 19 Mar 2013, 01:02 PM
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.
0
Navaneeth Kumar
Top achievements
Rank 1
answered on 19 Mar 2013, 01:35 PM
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
Tags
Scheduler
Asked by
Navaneeth Kumar
Top achievements
Rank 1
Answers by
Plamen
Telerik team
Navaneeth Kumar
Top achievements
Rank 1
Share this question
or