Grid CustomDataAdapterComponent DataUtil.Group throws Nullreference Exception

Hi,

for my project I implemented a CustomDataAdapterComponent. Here I override the Read function and  inside this function I use this line of code to group:
DataUtil.Group<TTarget>(dataSource, group, dm.Aggregates, 0, dm.GroupByFormatter);.
Here I get a null reference exception because my model contains int? and double?. I Decompiled your code an I think I found the issue. In the DataUtil class in function GetFormattedValue. Here you don't have a null check in line 590 (see screenshot).

To valid if I'm correct, I change all my types to non nullable. Then it works fine.
I use the latest version: Assembly Syncfusion.Blazor, Version=18.2.0.57

Would be cool if you can fix it fast, because I have it in production.

Best regards.

Attachment: Screenshot_20200918_at_13.14.22.png_90a0cbba.zip

3 Replies 1 reply marked as answer

RS Renjith Singh Rajendran Syncfusion Team September 21, 2020 11:38 AM UTC

Hi Nils, 

Greetings from Syncfusion support. 

We tried reproduce the problem by creating a sample based on the shared scenario(having int? and double? fields in Grid). But we could not face any problem when having these fields in Grid during grouping. We are attaching the sample which we have tried for your reference. Please download the sample form the link below, 
 
Please refer the codes from the above attached sample. If you still face difficulties, then the following details would be helpful for us to proceed further and provide you a solution as early as possible, 
  1. Share a detailed explanation of the problem you are facing.
  2. Share the details of exception/error if you are facing any in your application.
  3. Share the exact scenario/proper replication procedure to reproduce the problem.
  4. Share the complete Grid codes and model codes.
  5. Or if possible reproduce the problem with the attached sample and share with us for further analysis.

And also we suggest you to bind the “OnActionFailure” event to Grid. This event will be triggered for every failure in Grid. Please share the details you get in the “args” of this event handler for further analysis. 

The provided information will help us analyze the problem, and provide you a solution as early as possible. 

Regards, 
Renjith Singh Rajendran 



UN Unknown September 24, 2020 11:22 AM UTC

Hi,

I added our code into your example, but I'm not able to load the data into the grid, because of an exception. See screenshot in the attachment.
If you're able to load the data please try to group by column MRR.

Thanks for the help.

Attachment: GridExample_8b2895b9.zip


RS Renjith Singh Rajendran Syncfusion Team September 29, 2020 11:45 AM UTC

Hi Nils, 

Thanks for your update. 

We have analyzed the shared sample. We could see that only the pager is rendered in the first Grid. On further analysis, we found that the problem occurred because of empty values in _internalColumns of HQGrid.razor page. Please refer the screenshot below. So we suggest you to ensure to contain value in _internalColumns to render columns in Grid. 

 

We also checked by providing dummy value in _internalColumns, to define the columns for that Grid, now Grid(HQProjectsGrid) is rendered fine in the sample. So we suggest you to check the case based on this scenario from your side, and ensure to contain column details in _internalColumns. 

And also we could not face any exception when running the attached sample. We have attached a video demo showing this case from our side. Please download the video demo from the link below, 
 
Please get back to us if you need further assistance. 

Regards, 
Renjith Singh Rajendran 


Marked as answer
Loader.
Up arrow icon