Hi,
i'm a newbie in c# or telerik. i'm using the RadScheduleView and try to edit the appointment by double-clicking time and the appointment dialog is appear, after i click OK the new appointment is now appear in UI. But after i close the app and run it again, the schedule is empty. why?
what is the best way to save my appointment?
5 Answers, 1 is accepted
In order to save the created Appointments during run time and load them with the loading of the application we suggest you to use some DataBase. So, basically when you close your application all new created appointments should be added to the database and when you star it again the saved in the database appointments will be read from it and loaded inside RadScheduleView.
We have a detailed information in our help documentation about binding RadScheduleView with DataBase:
​http://docs.telerik.com/devtools/wpf/controls/radscheduleview/populating-with-data/binding-to-database/binding-to-db-overview
Please, check also the following sample project from our online SDK Repostitory that demonstrates how to bind RadScheduleView to a database. The example consist of RadScheduleView and a Button. When you press the button all Appointments will be saved inside the Database and when the application is run again all the appointments will be visualized as expected:
https://github.com/telerik/xaml-sdk/tree/master/ScheduleView/Database
Hopes the provided information will help you.
Regards,
Nasko
Telerik
Hi Nasko,
thanks for your answer, actually i intend to make a file (class or txt or anything) that after i made appointment from the Dialog it will write in that file like
Subject = "abc"
Start = new DateTime(xxxx,xx,xx)
End = new DateTime(xxxx,xx,xx)
something like that, and everytime i start again it will load from that file.
is that possible?
Thanks.
Sorry for the misunderstanding. Indeed you could achieve the desired functionality using a FileReader and Writer to read the text into the file and write it back again.
So, basically you will need to read the text from the file and using some implemented custom logic to create an Appointment from the read Text. Also, when a new Appointment gets created you need to add it to the file using some file writer.
We have created a sample project that demonstrates the described above approach using XamlReader and XamlWriter in order to write the appointments into a .xaml file.
Please, give it a try and let us know if it worked for you.
Hopes this helps.
Regards,
Nasko
Telerik
i still have to learn about the code and still dont understand some of it, but it works thank you so much.
i will post here if i have another question about it :)
I am glad the proposed approach worked for you and fits your requirements.
Please, do not hesitate to contact us if you have any additional questions concerning the proposed approach or some of the other Telerik controls.
Regards,
Nasko
Telerik