How can I get the VisibleRange.Start and VisibleRange.End when DayView?

4 posts, 0 answers
  1. Carlos
    Carlos avatar
    6 posts
    Member since:
    Aug 2012

    Posted 08 Mar 2013 Link to this post

    When VisibleRangeChanged event triggered, I can't get VisibleRange.Start and VisibleRange.End when the current View is DayView, but I can get them when MonthView and WeekView.
    Please help, thx.
  2. Vladi
    Admin
    Vladi avatar
    744 posts

    Posted 12 Mar 2013 Link to this post

    Hello Carlos,

    I am not sure if we understand what you are trying to achieve with the VisibleRangeChanged event.

    In the current version of RadScheduleView it is not possible to get the current visible hours range in the DayView (the current visible hours when the vertical scrollbar is visible). The VisibleRange represents the visible range of the current View, in WeekView by default it is equal to 7 days and in DayView it is equal to 1 day.

    Regards,
    Vladi
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  3. DevCraft banner
  4. Carlos
    Carlos avatar
    6 posts
    Member since:
    Aug 2012

    Posted 12 Mar 2013 Link to this post

    Hi Vladi,
    Please see the code below,

    xaml:
    <RadScheduleView x:Name="scheduleView" VisibleRangeChanged="scheduleView_VisibleRangeChanged" >

            xaml.cs:
    private void scheduleView_VisibleRangeChanged(object sender, EventArgs e)
            {
                var schedule = sender as ScheduleViewBase;
                if (schedule == null)
                {
                    return;
                }
           
         //Values I want to get
        var currentView = schedule.ActiveViewDefinition;
        var start = schedule.VisibleRange.Start;
              var end = schedule.VisibleRange.End;
        .....
     }

    When I switch to WeekView or MonthView, I can always get these values, but when I switch to DayView,  all of them are null. I want to get these values for SQL concatenation like " where StartTime > xxx and EndTime < yyy".
  5. Yana
    Admin
    Yana avatar
    4554 posts

    Posted 15 Mar 2013 Link to this post

    Hi Carlos,

    We've tested this but weren't able to reproduce the described issue - VisibleRange is set properly when switching to DayViewDefinition at our side. Could you please check which version of RadControls exactly you're using?

    Kind regards,
    Yana
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Back to Top