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

How to GET the row-height in weekview

1 Answer 58 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Martin
Top achievements
Rank 2
Martin asked on 03 Jul 2014, 02:07 PM
In my scheduler i leave the rowheight set to default, thinking this will work best with a varity of browsers (both desktop and mobile).

However i have created a 'current time indicator line' by adding an image to the timeslot.
As MinutesPerRow is set to 30, i do :

-----------
        protected void Scheduler_OnTimeSlotCreated(object sender, TimeSlotCreatedEventArgs e)
        {
            if (Scheduler.SelectedView == SchedulerViewType.WeekView || Scheduler.SelectedView == SchedulerViewType.DayView)
            {
                if (e.TimeSlot.Start.Date == DateTime.Now.Date)
                {
                    e.TimeSlot.CssClass = "today";
                }
                if ((e.TimeSlot.End < DateTime.Now.AddMinutes(30)) && (e.TimeSlot.End > DateTime.Now))
                {
                    int currentMinute = (DateTime.Now.Minute >= 30) ? DateTime.Now.Minute - 30 : DateTime.Now.Minute;
                    e.TimeSlot.CssClass = "now" + currentMinute;
                }
            }
        }

-----------

In the aspx page i have cssclasses like :

-----------
        html .RadScheduler .now0 {
            background: #FFFBE6;
            background-image: url('/images/Scheduler/1.png');
            background-repeat: repeat-x;
        }
        html .RadScheduler .now1 {
            background: #FFFBE6;
            background-image: url('/images/Scheduler/2.png');
            background-repeat: repeat-x;
        }
        html .RadScheduler .now2 {
            background: #FFFBE6;
            background-image: url('/images/Scheduler/3.png');
            background-repeat: repeat-x;
        }
-----------

See attached file for 1 one of the images, in this case 14.png

It looks like this works fine, except for the fact that the row height is set to 25px and my images are 30px high.
So from minute 26-29 and 56-59 the correct image is shown, but my red-dotted-line on the image is shown OUTSIDE the timeslot (thus NOT shown).

What i would like to do now is GET the rowheight used by the scheduler and use that to calculate which image should be shown.

So : is there a way to GET the rowheight being used by the scheduler ?





1 Answer, 1 is accepted

Sort by
0
Plamen
Telerik team
answered on 08 Jul 2014, 11:30 AM
Hello,


By default RadScheduler has the same row height for all the timeslots so if you do not set ti you can you 25 pixels for all the slots  as you mentioned.

If you want to get the row height on the client side you can use get_rowHeight() method of RadScheduler  client object.

Hope this information will be helpful. 

Regards,
Plamen
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
Scheduler
Asked by
Martin
Top achievements
Rank 2
Answers by
Plamen
Telerik team
Share this question
or