DateRange picker throws error on clicking the calender icon only in mobile and tablet screen resolutions

I'm using .netcore 5, Syncfusion blazor server side v 18.4.0.31.

SfDateRangePicker works fine with desktop screen resolution, but in mobile and tablet resolution the whole thing crashes.

Below is the error I get :

Error: System.NullReferenceException: Object reference not set to an instance of an object. at Syncfusion.Blazor.Calendars.SfDateRangePicker`1.BindRenderDayEvent(RenderDayCellEventArgs eventArgs) at Syncfusion.Blazor.Calendars.Internal.CalendarDayCell`1.triggerDayCellEvent() at Syncfusion.Blazor.Calendars.Internal.CalendarDayCell`1.renderDayCell(DateTime currentDate, TCalendarCell dateValue, Boolean multiSelection, DateTime[] values) at Syncfusion.Blazor.Calendars.Internal.CalendarDayCell`1.renderCell(DateTime currentDate, TCalendarCell dateValue, Boolean multiSelection, DateTime[] values, CalendarView calendarView) at Syncfusion.Blazor.Calendars.Internal.CalendarDayCell`1.OnInitializedAsync() at Microsoft.AspNetCore.Components.ComponentBase.RunInitAndSetParametersAsync()

Code snippet :

<sfdaterangepicker id="Calender" cssclass="CalenderCss" tvalue="DateTime?" @bind-startdate="@Fromdate" @bind-enddate="@Todate" strictmode="true" max="@MaxDate" width="58%" placeholder="Choose From and To dates">

 </sfdaterangepicker>

@code {

public DateTime? Fromdate { get; set; }

public DateTime? Todate { get; set; }

public DateTime MaxDate { get; set; }

protected override async Task OnInitializedAsync()

{

Todate = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day);

Fromdate = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day);

MaxDate = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day);

//Todate = DateTime.Today; //Fromdate = DateTime.Today.AddDays(-2); //MaxDate = DateTime.Today;

await Task.Yield();

await LoadreportData();

}

protected async Task LoadreportData()

{

VisibleProperty = true;

Spinnercaption = "Loading Data...";

BoolAllowFilter = false;

objreportprocesser.Fromdate = Fromdate;

objreportprocesser.Todate = Todate;

StateHasChanged();

Spinnercaption = "";

}

}


Attachment: Reports_1f79ab24.rar


5 Replies

BC Berly Christopher Syncfusion Team August 9, 2021 06:54 AM UTC

Hi Varun, 
  
Greetings from Syncfusion support. 
  
We were able to reproduce the reported issue at our end and this issue has been resolved in the product version 18.4.0.35. So, we suggest you to upgrade the Syncfusion product version to the mentioned NuGet version or latest version (19.2.0.51) to get rid of the reported issue. 
  
For your convenience, we have prepared the sample and attached it below. 
  
Regards, 
Berly B.C 



VD Varun D replied to Berly Christopher August 10, 2021 06:26 AM UTC

Hi Berly Christopher,

I'm getting below error on changing the version from 18.4.0.31 to  18.4.0.35


Failed to load resource: the server responded with a status of 404 ()

blazor.server.js:19 [2021-08-10T06:21:24.460Z] Error: Microsoft.JSInterop.JSException: Failed to fetch dynamically imported module: https://localhost:5001/_content/Syncfusion.Blazor/scripts/sf-spinner-87be8b.min.js

TypeError: Failed to fetch dynamically imported module: https://localhost:5001/_content/Syncfusion.Blazor/scripts/sf-spinner-87be8b.min.js

   at Microsoft.JSInterop.JSRuntime.InvokeWithDefaultCancellation[T](String identifier, Object[] args)

   at Microsoft.JSInterop.JSRuntimeExtensions.InvokeVoidAsync(IJSRuntime jsRuntime, String identifier, Object[] args)

   at Syncfusion.Blazor.Internal.SfBaseUtils.ImportModule(IJSRuntime jsRuntime, SfScriptModules scriptModule, String hashKey)

   at Syncfusion.Blazor.Internal.SfBaseUtils.ImportDependencies(IJSRuntime jsRuntime, List`1 dependentScripts, SfScriptModules scriptModules, String hashKey)

   at Syncfusion.Blazor.ScriptDependencies.ImportScripts()

   at Syncfusion.Blazor.SyncfusionBlazorService.UpdateSyncfusionService(Boolean isDevice)

   at System.Threading.Tasks.Task.<>c.<ThrowAsync>b__139_0(Object state)

   at Microsoft.AspNetCore.Components.Rendering.RendererSynchronizationContext.ExecuteSynchronously(TaskCompletionSource`1 completion, SendOrPostCallback d, Object state)

   at Microsoft.AspNetCore.Components.Rendering.RendererSynchronizationContext.<>c.<.cctor>b__23_0(Object state)

   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)

--- End of stack trace from previous location where exception was thrown ---

   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)

   at Microsoft.AspNetCore.Components.Rendering.RendererSynchronizationContext.ExecuteBackground(WorkItem item)



BC Berly Christopher Syncfusion Team August 10, 2021 01:00 PM UTC

Hi Varun, 
  
We suspect that you have passed argument such as true or false in the AddSyncfusionBlazor method in the Startup.cs file. Due to this, the script for the component will not be loaded properly in the application. So, we suggest you to call the AddSyncfusionBlazor() method without any arguments as mentioned in the below documentation.  
  
  
Else, the reported issue may be caused due to NuGet cache. So, please clear your NuGet cache from your application and tried to reproduce the sample and provide the details.  
  
  
Still issue persists, please share any issue reproducing sample or code example of component rendering and startup.cs file that will help us to check and proceed further from our end.  
  
Regards, 
Berly B.C 



VD Varun D December 29, 2021 11:07 AM UTC

Hi Berly Christopher ,


Issue still persist. I have attached code example along with startup.cs file, kindly look at the same and revert to us.


Thankyou,

Varun D


Attachment: files_7b61baa2.rar



BC Berly Christopher Syncfusion Team December 30, 2021 04:01 PM UTC

Hi Varun, 
  
We have checked the sample and the reported issue does not occurred at our end. So, we have prepared the sample and attached it below. 
  
  
So, please share the issue reproducing sample which will help us to check and proceed further from our end. 
  
Regards, 
Berly B.C 


Loader.
Up arrow icon