Appointments from multiple datasources

Hi,
I have two different appointment tables and would like to display that appointments in one scheduler, is that possible?

Thank you
Jyothi

2 Replies 1 reply marked as answer

RV Ravikumar Venkatesan Syncfusion Team October 5, 2020 11:11 AM UTC

Hi Jyothi, 

Greetings from Syncfusion support. 

We have validated your reported query “I have two different appointment tables and would like to display that appointments in one scheduler, is that possible?” at our end. We have achieved your requirement with the help of the below code and the same available in the below sample. 

[HomeController.cs] 
        public JsonResult LoadData(Params param) 
        { 
            // Fetching data from the different tables 
            var data1 = tbl1.Tables.ToList(); 
            var data2 = tb2.AppointmentTables.ToList(); 
 
            // Comining the different tables data to the one variable 
            List<AppointmentData> resultData = new List<AppointmentData>(); 
            for(int i = 0; i < data1.Count; i++) 
            { 
                resultData.Add(new AppointmentData { Id = data1[i].Id, Subject = data1[i].Subject, StartTime = data1[i].StartTime, EndTime = data1[i].EndTime, Description = data1[i].Description }); 
            } 
            for(int i = 0; i < data2.Count; i++) 
            { 
                resultData.Add(new AppointmentData { Id = data2[i].Id, Subject = data2[i].Subject, StartTime = data2[i].StartTime, EndTime = data2[i].EndTime, Description = data2[i].Description }); 
            } 
 
            // Returning the combined data 
            return Json(resultData, JsonRequestBehavior.AllowGet); 
        } 


Kindly try the above sample and get back to us if you need any further assistance. 

Regards, 
Ravikumar Venkatesan 


Marked as answer

JL jyothi lekshmi October 6, 2020 12:34 PM UTC

Thank you so much for your assistance, works really great.
I have one more question, if two table has different fields how to map the fields in scheduler.?
How to display two different titles?

Loader.
Up arrow icon