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

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

3 Answers 115 Views
ScheduleView
This is a migrated thread and some comments may be shown as answers.
Carlos
Top achievements
Rank 1
Carlos asked on 08 Mar 2013, 09:16 AM
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.

3 Answers, 1 is accepted

Sort by
0
Vladi
Telerik team
answered on 12 Mar 2013, 02:26 PM
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.

0
Carlos
Top achievements
Rank 1
answered on 13 Mar 2013, 01:35 AM
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".
0
Yana
Telerik team
answered on 15 Mar 2013, 11:43 AM
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.

Tags
ScheduleView
Asked by
Carlos
Top achievements
Rank 1
Answers by
Vladi
Telerik team
Carlos
Top achievements
Rank 1
Yana
Telerik team
Share this question
or