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

Is it possible to insert text in the All Day row?

2 Answers 81 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Paul Fountain
Top achievements
Rank 1
Paul Fountain asked on 18 Feb 2010, 07:19 PM
I'd like to display some text in the all day row.  The text will be different for each day.  Is this possible?  Another option would be to change the actual date header (where it currently displays "Mon, 15").

Has anybody accomplished this, and can give some tips?

2 Answers, 1 is accepted

Sort by
0
Accepted
Princy
Top achievements
Rank 2
answered on 19 Feb 2010, 02:16 PM
Hello Paul,

Try out the following approach in order to add Label control in AllDay row of RadScheduler.

C#:
 
    protected void RadScheduler1_TimeSlotCreated(object sender, TimeSlotCreatedEventArgs e) 
    { 
        if (e.TimeSlot.Index == "0:0:0"
        { 
            Label lbl = new Label(); 
            lbl.Text = "My Text"
            e.TimeSlot.Control.Controls.Add(lbl); 
        } 
    } 

Thanks,
Princy.
0
Paul Fountain
Top achievements
Rank 1
answered on 19 Feb 2010, 03:42 PM
Thanks Princy, your code got me on the right track.  My final code is posted below, see the comments for a few changes that I made.
        protected void RadScheduler1_TimeSlotCreated(object sender, TimeSlotCreatedEventArgs e) 
        { 
            // Control will be null if all day row is hidden 
            if (e.TimeSlot.Control == nullreturn
 
            // If duration is 1 day, this is a day header, and not a regular table cell 
            if (e.TimeSlot.Duration.Days == 1) 
            { 
                TableCell cell = e.TimeSlot.Control as TableCell; 
                if (cell == nullreturn// Just in case it's not a TableCell 
                cell.Text = string.Format("Max Slots: {0}", Demo.GetMaxDemosPerTime(e.TimeSlot.Start)); 
            } 
        } 
 

Tags
Scheduler
Asked by
Paul Fountain
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Paul Fountain
Top achievements
Rank 1
Share this question
or