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

[Solved] set focus to current time

1 Answer 160 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
vassu
Top achievements
Rank 1
vassu asked on 26 Jun 2008, 12:04 PM
I am using the Scheduler for Resource Grouping.
I want the focus to be on the first resource and the current system time when I load the scheduler.
eg:- if it is 2.30 pm then  the focus should be on the first resource and the current time ie 2.30pm.

Thanks,
Vassu

1 Answer, 1 is accepted

Sort by
0
Accepted
Peter
Telerik team
answered on 27 Jun 2008, 03:30 PM

Hello vassu,

Please, try the follwoing solution:
protected void RadScheduler1_TimeSlotCreated(object sender, Telerik.Web.UI.TimeSlotCreatedEventArgs e)  
    {           
        string[] indexParts = e.TimeSlot.Index.Split(':');  
        int resourceIndex = int.Parse(indexParts[0]);  
        if ((resourceIndex == 0) & (DateTime.Compare(e.TimeSlot.Start.Date, DateTime.Now.Date)==0)&(e.TimeSlot.Start.Hour == DateTime.Now.Hour))  
        {  
            e.TimeSlot.CssClass = "CurrentTimeSlotCss";    
        }  
    } 

<style type="text/css">         
        .CurrentTimeSlotCss  
        {  
            backgroundyellow !important;    
        }  
    </style> 


Greetings
Peter
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
Scheduler
Asked by
vassu
Top achievements
Rank 1
Answers by
Peter
Telerik team
Share this question
or