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