Hi,
I want to bind UltraCalendarInfo used by WinSchedule with EF.
Is that possible ? Can anyone help me, when possible, with an example ?
Thnx
Hello Ton,
Thank you for posting to Infragistics Community!
I noticed that a similar question is discussed in this other forum thread. Please, note that according to our Support Policy we handle a single thread per question. This is for better consistency and to ensure that all your queries are addressed correctly. Thank you for understanding.
To address your specific question, I understand that you would like to bind the appointments in an UltraCalendarInfo control to objects representing them and contained within an EF Core DbSet, is that correct? What I can suggest is using the Local view of the DbSet, which as per its API in the Microsoft docs, can be used for data binding by populating the set with data and then binding to the local data through this property by calling ToBindingList() for WinForms:
this.ultraCalendarInfo1.DataBindingsForAppointments.DataSource = this.dbContext.Appointments.Local.ToBindingList(); this.ultraCalendarInfo1.DataBindingsForAppointments.StartDateTimeMember = "StartTime"; this.ultraCalendarInfo1.DataBindingsForAppointments.EndDateTimeMember = "EndTime"; this.ultraCalendarInfo1.DataBindingsForAppointments.SubjectMember = "Name";
For your convenience, I created a small sample demonstrating the idea with EF Core 6. It contains a DBContext class that overrides the OnModelCreating method to populate with example data. You can find the solution attached below. Please, note that you might have to restore/reinstall the EF Core and WinSchedule NuGet packages when running it on your side.
In conclusion, please, check out the referenced resources and let me know if they help. Also, please, keep in mind that working with EF Core as a framework is out of the scope of Infragistics Developer Support, as it is not directly related to Infragistics controls.
Best regards, Bozhidara Pachilova Associate Software Developer
3542.WinScheduleEFCore.zip