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

[Solved] How to specify startdate/enddate in query based on VisibleRangeStart/VisibleRangeEnd

2 Answers 109 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Christian Ulrich
Top achievements
Rank 1
Christian Ulrich asked on 12 Aug 2009, 06:54 AM
Hi,

I databind against a ObjectSource, like in the AppointmentList class example. 

I fill the AppointmentList manually from another datasource and would like to specify the query whith the actual timeinterval in the choosen in the Scheduler (VisibleRangeStart/VisibleRangeEnd).

I tried to set these values in sessions objects, but I can't find an event that have the VisibleRangeStart/VisibleRangeEnd values, and has not yet made the databind.

Is there a way to do this???

Best regards,
Christian

2 Answers, 1 is accepted

Sort by
0
Peter
Telerik team
answered on 12 Aug 2009, 11:30 AM
Hello Christian,

If you are looking for a RadScheduler event, that would be NavigationComplete. If you need to add appointments manually to an AppointmentCollection, here is how: 
using System.Collections;     
    
/* * *      
    
AppointmentCollection apts = new AppointmentCollection();        
((IList)apts).Add(new Appointment(1, DateTime.Now, DateTime.Now.AddHours(1), "Test"));         
    
 



Peter
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Christian Ulrich
Top achievements
Rank 1
answered on 12 Aug 2009, 11:44 AM
Hi Peter,

Thanks for the info, very usefull and I will try that as well...

I managed to set the sessions variables at the correct moment by using this approch:

    protected void Page_Load(object sender, EventArgs e)  
    {  
        ObjectDataSource1.Selecting += new ObjectDataSourceSelectingEventHandler(ObjectDataSource1_Selecting);  
    }  
 
    void ObjectDataSource1_Selecting(object sender, ObjectDataSourceSelectingEventArgs e)  
    {  
        HttpContext.Current.Session[ConstScheduledStart] = RadScheduler1.VisibleRangeStart.Date;  
        HttpContext.Current.Session[ConstScheduledEnd] = RadScheduler1.VisibleRangeEnd.AddDays(1).Date;  
    } 

Heavily inspired by the Optimized Queries example :-)

/Christian

Tags
Scheduler
Asked by
Christian Ulrich
Top achievements
Rank 1
Answers by
Peter
Telerik team
Christian Ulrich
Top achievements
Rank 1
Share this question
or