How to GET the row-height in weekview

2 posts, 0 answers
  1. Martin
    Martin avatar
    10 posts
    Member since:
    Dec 2013

    Posted 03 Jul 2014 Link to this post

    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 ?





  2. Plamen
    Admin
    Plamen avatar
    2729 posts

    Posted 08 Jul 2014 Link to this post

    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.

     
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top