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

removing imag button

1 Answer 43 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
beeta one
Top achievements
Rank 1
beeta one asked on 12 Sep 2012, 11:50 AM
hii
I have a scheduler and i am adding dynamic Image button in every slot but i need to remove that image button from some slots in which i have appointments. How can I achieve that?

thnks

1 Answer, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 12 Sep 2012, 12:07 PM
Hi Hash,

Try the following code snippet to remove the ImageButton from the timeslots which have appointments.

C#:
protected void RadScheduler1_TimeSlotCreated(object sender, TimeSlotCreatedEventArgs e)
    {
        if (e.TimeSlot.Appointments.Count == 0)
        {
            ImageButton btn = new ImageButton();
            btn.ImageUrl = "~/Images/bullet5.jpg";
            e.TimeSlot.Control.Controls.AddAt(0, btn);
        }
    }

Hope this helps.

Regards,
Princy.
Tags
Scheduler
Asked by
beeta one
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Share this question
or