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

3 posts, 1 answers
  1. Paul Fountain
    Paul Fountain avatar
    10 posts
    Member since:
    Jan 2010

    Posted 18 Feb 2010 Link to this post

    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. Answer
    Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 19 Feb 2010 Link to this post

    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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Paul Fountain
    Paul Fountain avatar
    10 posts
    Member since:
    Jan 2010

    Posted 19 Feb 2010 Link to this post

    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)); 
                } 
            } 
     

Back to Top