That's pretty weird but nevertheless very specific: if the Scheduler is loaded with POCO objects from EntityFramework with LazyLoading enabled (Castle.Proxies objects) them the k-event-drag-hint box is not shown (!)
It took me some time to figure it out...
Hi Marco,
I've been able to reproduce this and I have logged it for further review.
The workaround I can suggest is ensuring that the scheduler gets actual Event models, not the models that lazy loading creates, to avoid the discrepancy of the types which breaks things. Something like the following snippet (taken out of the sample project attached at the end of the post). The key thing is that if the scheduler is bound to the "Event" model, the data it receives must be of the same type but it seems to be coming down as the "Castle.Proxies.EventProxy" type which seems to be created at runtime by the EF lazy loading.
protected override void OnInitialized()
{
Appointments = new List<Event>();
//one way to materialize and copy the events to showcase the idea of creating actual model instances
var evtsProxies = dc.Events.ToList();
//instead of directly getting the collection from the context (this would normally be in a service but the concept is similar)
//Appointments = dc.Events.ToList();
foreach (var item in evtsProxies)
{
Event currEventCopy = new Event();
currEventCopy.Id = item.Id;
currEventCopy.Description = item.Description;
currEventCopy.EndTime = item.EndTime;
currEventCopy.IsAllDay = item.IsAllDay;
currEventCopy.StartTime = item.StartTime;
currEventCopy.Title = item.Title;
Appointments.Add(currEventCopy);
}
base.OnInitialized();
}
Regards,
Marin Bratanov
Progress Telerik
Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.
Hi Marin, I thought about CSS and I've already checked, the hint div is not present in the DOM.
Hello Marco,
Could you confirm for me if this screenshot shows the element you are not seeing:
Is this element missing altogether from the DOM, or is it missing styles that will make it visually distinct? I am attaching to this post a short video that shows one way you can see if the element is in the DOM or not. If it is in the DOM, but the styles are missing, the most probable reason is a problem with the Themes - for example, the version referenced by the app is too old, or the custom theme needs to be rebuilt against the latest version of the built-in theme it uses as base, or there is some CSS in the project that is interfering.
A while back we made an enhancement that seemed to fix issues with lazy loading proxies trough this item - the fix was to ignore the members marked with the "IgnoreDataMemberAttribute" attribute. Is it possible that some of the fields in the model are missing this attribute which makes them cloneable only through EF and not through third party code and reflection (which we need to use when copying items for editing)? We do need to create a copy of the model when it is being edited, and a drag operation is an edit operation. If the copy can't be created, there might be some exceptions (caught or not) that are causing a problem.
Regards,
Marin Bratanov
Progress Telerik
Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.