removing imag button

2 posts, 0 answers
  1. beeta one
    beeta one avatar
    63 posts
    Member since:
    Aug 2012

    Posted 12 Sep 2012 Link to this post

    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

  2. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 12 Sep 2012 Link to this post

    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.
Back to Top