problem in databinding in radscheduler

8 posts, 0 answers
  1. Tanvi
    Tanvi avatar
    7 posts
    Member since:
    Nov 2010

    Posted 05 Dec 2010 Link to this post

    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
  2. Richard Slade
    Richard Slade avatar
    3000 posts
    Member since:
    May 2009

    Posted 05 Dec 2010 Link to this post

    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
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Tanvi
    Tanvi avatar
    7 posts
    Member since:
    Nov 2010

    Posted 05 Dec 2010 Link to this post

    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.
  5. Richard Slade
    Richard Slade avatar
    3000 posts
    Member since:
    May 2009

    Posted 06 Dec 2010 Link to this post

    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
  6. Richard Slade
    Richard Slade avatar
    3000 posts
    Member since:
    May 2009

    Posted 07 Dec 2010 Link to this post

    Hello, 

    Did this help? If so, please mark as answer so others can find the solution too. 
    Thanks
    Richard
  7. Dobry Zranchev
    Admin
    Dobry Zranchev avatar
    348 posts

    Posted 09 Dec 2010 Link to this post

    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.
  8. Tanvi
    Tanvi avatar
    7 posts
    Member since:
    Nov 2010

    Posted 13 Dec 2010 Link to this post


    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
  9. Dobry Zranchev
    Admin
    Dobry Zranchev avatar
    348 posts

    Posted 16 Dec 2010 Link to this post

    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.
Back to Top
UI for WinForms is Visual Studio 2017 Ready