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

problem in databinding in radscheduler

7 Answers 186 Views
Scheduler and Reminder
This is a migrated thread and some comments may be shown as answers.
Tanvi
Top achievements
Rank 1
Tanvi asked on 05 Dec 2010, 11:03 PM
Hi

I am trying to bind my existing appointments from database to the radschedular. But it is showing only the current time's appointment which is not in the database. Eg: If I execute my code at 4.15 pm then it is creating an appointment from 4.15 pm to 4.15pm in radschedular. This appointment is not there in the database.

I have used the following code :

SchedulerBindingDataSource dataSource = new SchedulerBindingDataSource();

              
                AppointmentMappingInfo appointmentMappingInfo = new AppointmentMappingInfo();
                appointmentMappingInfo.Start = "FromTime";
                appointmentMappingInfo.End = "ToTime";
                appointmentMappingInfo.Summary = "Subject";
               
                appointmentMappingInfo.
UniqueId = "ReservationID";
              
                dataSource.EventProvider.Mapping = appointmentMappingInfo;
                // assign the generic List of MyAppointment as the EventProvider data source
               
                dataSource.EventProvider.DataSource = reservationBO.getActiveReservationsByRoom(this.RoomId).ToList();
                this.radScheduler1.DataSource = dataSource;
               

reservationBO.getActiveReservationsByRoom(this.RoomId).ToList(); - This is the list which I am pulling out from the database.

If I am using
this.radScheduler1.DataSource = reservationBO.getActiveReservationsByRoom(this.RoomId).ToList();
then it is showing an error message : "Cannot implicitly convert type 'System.Collections.Generic.List<RMAS.Data.Reservation>' to Telerik.WinControls.UI.SchedulerDataSource' "

how can I fix this. Need your help

7 Answers, 1 is accepted

Sort by
0
Richard Slade
Top achievements
Rank 2
answered on 05 Dec 2010, 11:12 PM
Hello,

You will need to use a SchedulerBindingSource for this. Please take a look at the following links which will help.

Databinding Radscheduler Introduction (Documentation)
Databinding RadScheduler for WinForms (Blog)
Codeless Databinding for RadScheduler (Telerik TV)

hope that helps
Richard
0
Tanvi
Top achievements
Rank 1
answered on 05 Dec 2010, 11:57 PM
Hi

Thanks it worked. I am able to show all my appointments that are in my database on the radscheduler. However, I want to show the appointments related to a room . Eg: User would be selecting a room and i want to show appointments related only to that room on the radschedular.

This function :
reservationBO.getActiveReservationsByRoom(this.RoomId).ToList()
is retreiving the reservations related to a room. Do I have to assign datasource to the above function.

Please help.
0
Richard Slade
Top achievements
Rank 2
answered on 06 Dec 2010, 10:00 AM
Hi Tanvi,

Frm what I see of your system, yes. You should assign a SchedlerBindingSource to that so you can bind your room based data to the scheduler.
Hope that helps. Please remember to mark answers in the forum so others can find solutions too.

All the best
Richard
0
Richard Slade
Top achievements
Rank 2
answered on 07 Dec 2010, 10:29 AM
Hello, 

Did this help? If so, please mark as answer so others can find the solution too. 
Thanks
Richard
0
Dobry Zranchev
Telerik team
answered on 09 Dec 2010, 04:27 PM
Hello Tanvi,

Thank you for writing.

If you want to see only appointments that are related to a ceratin room, you should use the rooms as resources and use the scheduler in grouping mode. In this case you will see the appointments separated in groups by rooms. All available documentation about grouping you can find here. In addition, you can review the available examples that are provided with the installation.

If you have other questions, feel free to write back.

Regards,
Dobry Zranchev
the Telerik team
Get started with RadControls for WinForms with numerous videos and detailed documentation.
0
Tanvi
Top achievements
Rank 1
answered on 13 Dec 2010, 11:40 PM

Please check the attached error.jpeg
I am getting this error for the event written below when I am binding the radscheduler with the list of roomid's
private void reservationsBindingSource1_CurrentChanged(object sender, EventArgs e)
{
}

How should i convert 'Systems.Collections.Generic.IList< > to Telerik.wincontrol.UI.SchedulerDataSource'
Would this method as in " reservationsBindingSource1_CurrentChanged() "  be called everytime a scheduler is loaded.

Please reply
0
Dobry Zranchev
Telerik team
answered on 16 Dec 2010, 05:18 PM
Hi Tanvi,

Thank you for writing back.

We do not support Current in RadScheduler data binding. You can vote for this task here. When this item collect enough votes, we will add it to our TO DO list.

In case that you have further questions, feel free to contact us.

All the best,
Dobry Zranchev
the Telerik team
Check out the Q1 2011 Roadmap for Telerik Controls for Windows Forms.
Tags
Scheduler and Reminder
Asked by
Tanvi
Top achievements
Rank 1
Answers by
Richard Slade
Top achievements
Rank 2
Tanvi
Top achievements
Rank 1
Dobry Zranchev
Telerik team
Share this question
or