Scheduler doesn't load data from DataManager

Hi,

I have trouble when I using the DataManager to load data into a Scheduler.
If I set the data directly into the DataSource of the SchedulerEventSettings, then the data load, but when I use the DataManger then not.

I created a example with 2 scheduler. You can find it into the counter.razor.

Another question: Can I use a DataManager for the SchedulerResource as well? And how will that look like.

Thanks for your help.
Best regards.

Attachment: Scheduler_e7cf3c63.zip

8 Replies 1 reply marked as answer

BS Balasubramanian Sattanathan Syncfusion Team November 4, 2020 02:07 PM UTC

Hi Nils, 

Greetings from Syncfusion Support. 

We have analyzed your reported scenario at our end and we would suggest you to use DataManager like the below code snippet. We have modified the sample which can be downloaded from the below link. And also we let you know that we can use the DataManager for the SchedulerResources too 

<ScheduleEventSettings TValue="AppointmentData"> 
    <SfDataManager AdaptorInstance="@typeof(CustomAdaptor)" Adaptor="Adaptors.CustomAdaptor"></SfDataManager> 
</ScheduleEventSettings> 


Kindly refer the above links and let us know if you need further assistance. 

Regards, 
Balasubramanian S


UN Unknown November 4, 2020 04:03 PM UTC

Hi, 

thanks for the answer. But I need to pass objects into the DataAdapter, which I initialize in the OnInitialized method. How can I do it ?

Best regards


UN Unknown November 9, 2020 03:55 PM UTC

Hi, is there an answer you can give me?


NR Nevitha Ravi Syncfusion Team November 9, 2020 04:08 PM UTC

Hi Nils, 

We are not clear about your requirement, can you please share following details to provide prompt solution. 
  • Whether you need custom component for CustomAdaptor
  • What you have to declare in OnInitialized
  • Whether you need to load the appointments for the first scheduler in the counter page.
  • Share the issue details if you are facing any

Regards, 
Nevitha 



UN Unknown November 9, 2020 07:05 PM UTC

Hi,

here the answers:

Whether you need custom component for CustomAdaptor
- yes

What you have to declare in OnInitialized
- The OnInitialized  is just an example. Base on the inputs and changes the user do in the UI, I need to update the Queryable. And then I need to update the Scheduler or Grid based on the new Queryable.

Whether you need to load the appointments for the first scheduler in the counter page.
- yes

Share the issue details if you are facing any

You can find an example in my first post (counter.razor). Here I using a DataAdaptor as BlazorComponent because I need to pass the DataSource into the DataAdapter. 
<SfDataManager Adaptor="Adaptors.CustomAdaptor">
     <HQSchedulerAdaptorComponent Date="@CurrentDate" DataSource="@DataSource">HQSchedulerAdaptorComponent>
SfDataManager>

This is necessary because the DataSource is an Queryable which I generate via Linq-Expressions. But for this I need to inject the DbContext and the repositories.
For convenience only I don't do this in the example. 

And the recommended way from you do not allow to inject in general, because the constructor need to be parameterless.
  

That is the reason why I inject everything in my blazor compoment (here the counter.razor), build the Queryable there and then pass it to the DataAdaptor.

Best regards




BS Balasubramanian Sattanathan Syncfusion Team November 10, 2020 02:40 PM UTC

Hi Nils, 

Thanks for the details. 

We have analyzed your problem at our end and let you know that you have declared the data manager wrongly and it is the cause for the reported problem. So we would suggest you to declare the data manager inside the schedule event settings like the below code snippet.  
<ScheduleEventSettings TValue="AppointmentDataDto">
<SfDataManager Adaptor="Adaptors.CustomAdaptor">
<HQSchedulerAdaptorComponent ></HQSchedulerAdaptorComponent>
</SfDataManager>
</ScheduleEventSettings>
 


Kindly try the above solution and let us know if you need further assistance. 

Regards, 
Balasubramanian S

Marked as answer

UN Unknown November 11, 2020 02:52 PM UTC

Thank you for the hint. I did't see that. Now it works.


NR Nevitha Ravi Syncfusion Team November 12, 2020 05:20 AM UTC

Hi Nils, 

You are welcome 😊, please get back to us if you need any assistance. 

Regards, 
Nevitha 


Loader.
Up arrow icon