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

Binding to LinQ datasource - resulting in some appointments not showing

3 Answers 136 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
mSchmidt
Top achievements
Rank 1
mSchmidt asked on 12 Aug 2008, 01:05 PM
Hi

Iam trying to bind a RadScheduler to a Linq datasource, i got everything working but all appointments after a specific date simply dont show up.

I tried debugging and the var q below here includes information about these appointment, however they show up in none of the RadSchedluer Views.


protected void RadScheduler1_DataBinding(object sender, EventArgs e)  
        {  
              
            FlexyNet.Data.FlexyBookLocalDataContext db = new FlexyNet.Data.FlexyBookLocalDataContext(Connections.CurrentCenterConnectionString);  
            var q = from v in db.vagtPlans  
                    orderby v.start  
                    where v.start < v.slut && v.personale_db.personale_custID == fUser.CustID && v.start >= RadScheduler1.VisibleRangeStart && v.slut <= RadScheduler1.VisibleRangeEnd  
                    select new { v.vagt_id, v.start, v.slut, kommentar = v.kommentar };  
            this.Label1.Text = q.ToString();  
            this.RadScheduler1.DataKeyField = "vagt_id";  
            this.RadScheduler1.DataEndField = "slut";  
            this.RadScheduler1.DataStartField = "start";  
            this.RadScheduler1.DataSubjectField = "kommentar";  
            this.RadScheduler1.DataSource= q;  
            this.RadScheduler1.Rebind();  
        } 

Does the RadScheduler it self only select the appointments within the visible range or do i have to do it as above to optimize speed ?

3 Answers, 1 is accepted

Sort by
0
Simon
Telerik team
answered on 14 Aug 2008, 01:12 PM
Hello mSchmidt,

Thank you for contacting Telerik support.

RadScheduler shows only Appointments from the Data Source which are in the current Visible Range. On the other hand, the Data Source returns those Appointments which it is configured to select. So, to optimize the behavior, you could select only the Appointments in the Visible Range from the Data Base.

Finally, in your case, it would be better if you move the code from the DataBinding event handler to somewhere else, i.e. in Page_Load in NavigationComplete as the DataBinding event fires when the Scheduler is bound.

Greetings,
Simon
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
mSchmidt
Top achievements
Rank 1
answered on 14 Aug 2008, 01:23 PM
Okay, however this does not explain why some appointsments would not show up.

I have a Datasource which have databound both to a grid and a scheduler, in the grid all appointments show up, however all after the 17. are not shown in the RadScheduler.
0
Simon
Telerik team
answered on 15 Aug 2008, 01:53 PM
Hello mSchmidt,

There may be various reasons for this to be happening.

Ideally, it would be best if you send us a sample project or a page which exhibits the problem, so that we can investigate it directly.

Please send us a sample page/project by opening a formal support ticket and attaching the file there. We will look into the issue and will provide you with further assistance.

Best wishes,
Simon
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
Scheduler
Asked by
mSchmidt
Top achievements
Rank 1
Answers by
Simon
Telerik team
mSchmidt
Top achievements
Rank 1
Share this question
or