We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

Null object reference exception

Hello Syncfusion,
When I click on icon Filter in SFDataGrid (filter icon in the column head) the application throws the null reference exception.
I initialized the SFDataGrid Filter as following and before set DataSoure to my data list.

            SfDataGrid.AllowFiltering = true;
            SfDataGrid.ShowRowHeader = true;
            SfDataGrid.FilterPopupMode = Syncfusion.WinForms.GridCommon.FilterPopupMode.Both;

NB: I use Version 17.1.0.38

Best regards 

5 Replies

FP Farjana Parveen Ayubb Syncfusion Team July 31, 2019 09:24 AM UTC

Hi Cosyspro, 
 
Thank you for using Syncfusion controls. 
  
We have analyzed your query to enable the filter before setting the DataSource. We have prepared simple sample based on the provided information but we are unable to reproduce the reported issue from our end. Please find the sample and video from the link below 
  
  
  
If still you are facing the same issue, please revert us with the modified sample. It will helps us to investigate further and provide appropriate solution at earlier. 
  
Regards, 
Farjana Parveen A 



CO Cosyspro July 31, 2019 02:20 PM UTC

Hi Farjana,
Thank you for your response.
I used your example and it works fine. However, I integrated your example in my project without modification source code. When I click on filter icon of your example sometimes work fine and sometimes the application throws the following exception "object reference not set to an instance of an object". See the below image showing the exception.
There is conflict between SfDataGrid and other components ?

Information: 
1) I use SfDataGrid since the version 16.4.0.42 and I update my project by Project Migration (your tool in Essential Studio) each time there is update of your product
2) The problem has occurred since the version 17.1.0.38

Regards
Cosyspro  

Attachment: errorSfDataGridFilter_11f9c3bd.zip


FP Farjana Parveen Ayubb Syncfusion Team August 1, 2019 09:34 AM UTC

 
Hi Cosyspro, 
 
Thank you for your update. 
 
We have analyzed your stack trace and tested the application in your Syncfusion version but the issue is not reproduced on our end. Could you please share the details, whether did you customize the GridFilterControl in your application? If so, please share that code or simple sample to replicate the issue that will help us to provide the better solution. 
 
Regards, 
Farjana Parveen A 



CO Cosyspro August 16, 2019 08:11 AM UTC

Hi Farjana,
Thank you for your response.
After long time of investigation and researsh, I found the source of exception. The problem commes from the Localization. So, when I exclure  Syncfusion.SfDataGrid.WinForms.resx from the project, the filter works without exception.
Can you verify the contnent of the Syncfusion.SfDataGrid.WinForms.resx ?

Best regards

Attachment: Resources_d69258d0.zip


SP Shobika Palani Syncfusion Team August 19, 2019 01:29 PM UTC

Hi Cosyspro, 

Thanks for your update. 

On analyzing based on the provided update, it seems that you are using localization in your application. And we suspect that you might not included updated default resource file of SfDataGrid. And we have prepared simple sample with the updated resource file and filtering is working fine at our end.  

Please find sample for the same from the link below 

Sample Link: 

Further, we are facing issue in text rendering for “ok” and “cancel” buttons shown in FilterPopup in the version 17.1.0.38. We are now validating this issue from our end and we will update you with more details on 21st August,2019. 

We will appreciate your patience until then. 

Regards, 
Shobika. 


Loader.
Live Chat Icon For mobile
Up arrow icon