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

Formatting Stat Holidays

9 Answers 100 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Chris
Top achievements
Rank 1
Chris asked on 11 Aug 2008, 01:58 PM
Hi,

I was just wondering if it's possible to format specific dates.  I have a list of Stat holidays that I want to grab from the database and I basically just want them to be a different colour than all the other dates.  Is that possible?

9 Answers, 1 is accepted

Sort by
0
Chris
Top achievements
Rank 1
answered on 12 Aug 2008, 01:32 PM
It may be actually easier to ask if it's possible to format individual cells?
0
Simon
Telerik team
answered on 14 Aug 2008, 09:03 AM
Hello Chris,

Thank you for contacting Telerik support.

It is possible to change the appearance of the Time Slots of RadScheduler. You could change the CSS of the Time Slots in Week and Month View, as they are created on the server depending on whether they are special Holidays.

For example, assuming that you have the special Holidays list already loaded in an ArrayList you could try the following:

     protected void RadScheduler1_TimeSlotCreated(object sender, TimeSlotCreatedEventArgs e) 
    { 
        if (this.RadScheduler1.SelectedView == SchedulerViewType.WeekView || 
            this.RadScheduler1.SelectedView == SchedulerViewType.MonthView) 
        { 
            if (specialHolidays.IndexOf(e.TimeSlot.Start.Date) > -1) 
            { 
                e.TimeSlot.CssClass = "specialHoliday"
            } 
        } 
    } 

Here, specialHoliday is the name of the CSS class defined on the page:

        .specialHoliday 
        { 
            backgroundyellow !important; 
        } 

Best wishes,
Simon
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Chris
Top achievements
Rank 1
answered on 14 Aug 2008, 01:31 PM
I believe I'm using an older version of the control and there's no way I can get the updated version.  All the events I can use are:

AppointmentCancelingEdit
AppointmentClick
AppointmentCommand
AppointmentCreated
AppointmentDataBound
AppointmentDelete
AppointmentInsert
AppointmentUpdate
Databinding
Databound
Disposed
FormCreated
FormCreating
Init
Load
NavigationCommand
NavigationComplete
PreRender
Unload

Is there anything I can do with those at all?
0
Simon
Telerik team
answered on 15 Aug 2008, 01:51 PM
Hi Chris,

The TimeSlotCreated event is available in the version (2008.2.723) that you have specified to be using.

If this is not your version, please upgrade.

Kind regards,
Simon
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Kate
Top achievements
Rank 1
answered on 07 May 2010, 08:41 PM
Is this still the recommended solution?
Are there other ways of doing this now with later versions in place?
I am looking for ability to use colour and or images for list of stats.  Note: this will also need to take into consideration users from several locations that may have different stats according to location.
0
T. Tsonev
Telerik team
answered on 10 May 2010, 02:43 PM
Hello Kate,

This is still the recommended solution. We don't have any mechanism in place to allow you to customize the appearance of the time slot in a way that doesn't require writing code. We will consider our options for solving this problem in a more intuitive way.

Greetings,
Tsvetomir Tsonev
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Chris
Top achievements
Rank 1
answered on 10 May 2010, 04:36 PM
Is it possible to also add hover text to the cell that has the holiday?  I'm storing the Holidays in a hash table, with the date being the key, and the value being the name of the holiday.  I want the user to have the ability to see what the name of the holiday is.  This is what I currently have.   My CSS class currently just has the background colour set.

Protected Sub radScheduler_TimeSlotCreated(ByVal sender As ObjectByVal e As TimeSlotCreatedEventArgs) Handles radScheduler.TimeSlotCreated 
        If radScheduler.SelectedView = SchedulerViewType.WeekView Or radScheduler.SelectedView = SchedulerViewType.MonthView Then 
            If Holidays.ContainsKey(e.TimeSlot.Start.DateThen 
                e.TimeSlot.CssClass = "specialHoliday" 
            End If 
        End If 
    End Sub 

0
Accepted
Peter
Telerik team
answered on 12 May 2010, 03:30 PM
Hello Chris,

Please, try the following:

Protected Sub RadScheduler1_TimeSlotCreated1(sender As Object, e As TimeSlotCreatedEventArgs)
    e.TimeSlot.Control.Attributes.Add("title", "custom tooltip")
End Sub


Best wishes,
Peter
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Chris
Top achievements
Rank 1
answered on 12 May 2010, 03:54 PM
That works.  Thanks!
Tags
Scheduler
Asked by
Chris
Top achievements
Rank 1
Answers by
Chris
Top achievements
Rank 1
Simon
Telerik team
Kate
Top achievements
Rank 1
T. Tsonev
Telerik team
Peter
Telerik team
Share this question
or