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

How to hide dynamically added control from particular date slot

1 Answer 52 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Manish
Top achievements
Rank 2
Manish asked on 24 Aug 2012, 09:11 AM
Hi,

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 data. so please tell me some solution.
 
I am adding Image button by this:

 protected void RadScheduler1_TimeSlotCreated(object sender, TimeSlotCreatedEventArgs e)
        {
            ImageButton btn = new ImageButton();
            btn.ImageUrl = "~/Images/Add.png";
            btn.CssClass = "FloatRight";
            e.TimeSlot.Control.Controls.AddAt(0, btn);
            btn.CommandName = "btn";
            btn.CommandArgument = e.TimeSlot.Start.Date.ToString();
            btn.Command += new CommandEventHandler(GoToUnitNumber);          
        }

Please check the attachment

1 Answer, 1 is accepted

Sort by
0
Accepted
Princy
Top achievements
Rank 2
answered on 24 Aug 2012, 09:39 AM
Hi Manish,

Try the following code snippet to achieve your scenario.

C#:
protected void RadScheduler1_TimeSlotCreated(object sender, TimeSlotCreatedEventArgs e)
 {
   if (e.TimeSlot.Appointments.Count == 0)
     {
        ImageButton btn = new ImageButton();
        btn.ImageUrl = "~/Images/Add.png";
        btn.CssClass = "FloatRight";
        e.TimeSlot.Control.Controls.AddAt(0, btn);
        btn.CommandName = "btn";
        btn.CommandArgument = e.TimeSlot.Start.Date.ToString();
        btn.Command += new CommandEventHandler(GoToUnitNumber);       
     
 }

Hope this helps.

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