Null reference exception when assigning the data source

Hi,

I'm using Syncfusion version 18.2460.0.59 and I got a null reference exception at the line that assigns the data source of the sfDataGrid to an observable collection. 

sfDataGrid_RigsDepartments.DataSource = rigWellDepartments

After some investigation I found that the exception would disappear if I do one of the following:

1- Comment out the line that adds the last ComboBox column to the data grid:

// Comment the below to avoid the null reference exception
// sfDataGrid_RigsDepartments.Columns.Add(new GridComboBoxColumn() { MappingName = "DepartmentId", HeaderText = "Department",
//                ValueMember = "DepartmentId", DisplayMember = "DepartmentName", IDataSourceSelector = new DepartmentSelector() });

2- Go to the designer AutoSizeColumnsMode property from "All Cells" to None.

I've attached the project so you can reproduce the problem. To reproduce it, please follow these steps:
1- Run the attached project
2- Select any item in the combo box, this should populate the datagrid and produce the exception.
3- Go to the designer and change the AutoColumnsMode property from All Cells to None. Re run the application and the problem disappears.


Attachment: SFDataGridWithComboBox_15eafa39.zip

4 Replies 1 reply marked as answer

VS Vijayarasan Sivanandham Syncfusion Team October 1, 2020 02:57 PM UTC

Hi Ahmad,

Thank you for contacting Syncfusion support.

Currently, we are analyzing your requirement of “Null reference exception when assigning the data source in SfDataGrid”. We will validate and update you the details on or before
October 06, 2020. 
 
We appreciate your patience until then. 
 
Regards, 
Vijayarasan S 



VS Vijayarasan Sivanandham Syncfusion Team October 6, 2020 06:10 PM UTC

Hi Ahmad,

Sorry for the inconvenience caused.

We are trying to achieve your requirement” Null reference exception when assigning the data source in SfDataGrid”. but we get some technical issue based on our source architecture. So, we are checking the feasibility to achieve your requirement. We will validate and update you the details on October 08, 2020.

We appreciate your patience until then. 
 
Regards, 
Vijayarasan S




VS Vijayarasan Sivanandham Syncfusion Team October 8, 2020 03:22 PM UTC

Hi Ahmad,

Thank you for your patience.


We have created bug report for the reported issue “Null reference exception occurs while GridComboBoxColumn defined with IDataSourceSelector after assigning the DataSource of SfDataGrid”. You are using NuGet package version and we did not provide patch for NuGet version. So, we will fix this issue and include in our October 27th ,2020 NuGet release.

You can track the status of this report through the following feedback link,

Feedback link:
https://www.syncfusion.com/feedback/18585/null-reference-exception-occurs-while-gridcomboboxcolumn-defined-with 
Note: The provider feedback link is private, and you need to login to view this feedback.

We appreciate your patience until then.

Regards,
Vijayarasan S
 



VS Vijayarasan Sivanandham Syncfusion Team October 27, 2020 10:20 AM UTC

Hi Ahmad,

Thank you for your patience.

We are glad to announce that our latest weekly NuGet package update version 18.3.0.44  has been is rolled out with the “Null reference exception occurs while GridComboBoxColumn defined with IDataSourceSelector after assigning the DataSource of SfDataGrid” and is available for download.

Feedback link: https://www.syncfusion.com/feedback/18585/null-reference-exception-occurs-while-gridcomboboxcolumn-defined-with
 

We hope this helps. Please let us know, if you require further assistance on this.

Regards,
Vijayarasan S



Marked as answer
Loader.
Up arrow icon