display json result in the schedule

Hello Syncfusion Team
i'm trying to display a JSON into the Schedule but i get an Error  i don't know how to fix it  i'm i missing something
please help me 
Thank you

Attachment: Schedule_2bb2555.rar

5 Replies

VR Vigneshkumar Ramasamy Syncfusion Team September 4, 2018 12:44 PM UTC

Hi Soufiane, 
 
Thanks for contacting Syncfusion support. 
 
We have checked with the provided information. We suspect that the issue “RuntimeBinderException: Newtonsoft.Json.Linq.Property doesn’t contain definition for date_start” is due to JResponse_Student doesn’t contain the date_start parameter. We also noticed date_start and date_end is commended in your provided Restepf file. Could you please confirm whether JResponse_Student contains date_start parameter?   
  
Note:   
To convert date time from string using Convert.ToDateTime, date time string must be in convertable format. We have observed that value provided for date_start in Restepf file is not in converable format "20170904T090000" which will cause exception, you can also use TryParse.    
  
Regards,  
Vigneshkumar R 



UN Unknown Syncfusion Team September 5, 2018 08:23 AM UTC

Hi Vigneshkumar, 

i was able to Display my json result  in the Schedule with your suggestion TryParse  i used ParseExact and it's seems to work . This is my code


            foreach (var data in jsonDataCollection)
            {
                DateTime startime = DateTime.ParseExact(data.date_start.ToString(), "yyyyMMddTHHmmss",
                                    System.Globalization.CultureInfo.InvariantCulture);
                DateTime endtime = DateTime.ParseExact(data.date_end.ToString(), "yyyyMMddTHHmmss",
                                    System.Globalization.CultureInfo.InvariantCulture);
                string descrption = data.descrption.ToString();
                string type = data.type.ToString();

                Meetings.Add(new Meeting()
                {

                    EventName = descrption,
                    From = startime,
                    To = endtime,
                    Color = Color.FromHex("#5944dd"),

                });
            }


 
i need to add a button to change the ScheduleView into week view, work week view, day view. 
Do you have some suggestionx Thank you

Attachment: Schedule_5637b4ca.rar


VR Vigneshkumar Ramasamy Syncfusion Team September 6, 2018 06:44 AM UTC

Hi Soufiane,  
 
Regarding “Display my json result in the Schedule” 
 
We are glad to know that your requirement has been achieved. 
 
Regarding “Add a button to change the ScheduleView into week view” 
 
You can change the schedule view to week view, work week view and day view by using ScheduleView property of SfSchedule. Kindly find the code snippet below,  
  
        button.Clicked += Button_Clicked;  
…  
  
        private void Button_Clicked(object sender, EventArgs e)  
        {  
            schedule.ScheduleView = Syncfusion.SfSchedule.XForms.ScheduleView.WeekView;  
        }  
  
You can also refer our online User Guide Documentation and knowledge base by using the below link,  
  
Please let us know if this helpful. 
 
Regards,  
Vigneshkumar R 



UN Unknown Syncfusion Team September 14, 2018 09:54 AM UTC

Thank you for your help  i was able to switsh between views  one last question please is when i click in an appointment i want a page wish contant the appointment information 


VR Vigneshkumar Ramasamy Syncfusion Team September 17, 2018 12:28 PM UTC

Hi Soufiane, 
 
You can display the selected appointment details in new page by using CellTapped event, this event will be triggered while performing touch actions in timeslots, month cells and in appointments. You can get the selected appointments details using Appointment property for day, week and work week views and Appointments property for month view of CellTappedEventArgs. And, this selected appointment details can be displayed in new content page, kindly refer the code snippet below,  
  
Code snippet:  
schedule.CellTapped += Schedule_CellTapped;
  
  
void Schedule_CellTapped(object sender, CellTappedEventArgs e)  
{  
    // You can obtain the selected appointment details for day, week and work week view  
    var appointment = e.Appointment;  
  
    // You can obtain the appointments details in selected month cell for month view  
    var appointments = e.Appointments;  
  
    // By using Appointment and Appointments property you can display the details in new page  
    this.Navigation.PushAsync(new ContentPage());  
}  
  
  
public App()  
{  
    InitializeComponent();  
  
    MainPage = new NavigationPage(new Sample.MainPage());  
}  
  
  
Similarly, for appointments in month inline view, you can get the selected appointment details using Appointment property of MonthInlineAppointmentTappedEventArgs in MonthInlineAppointmentTapped event.   
  
You can also refer our online User Guide Documentation by using the below links.  
  
Regards,  
Vigneshkumar R 


Loader.
Up arrow icon