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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to resolve Null reference exception in the GGC while changing the DataSource in the ComboBox RecordValueChanged event?

Platform: WinForms |
Control: GridGroupingControl |
Published Date: April 22, 2015 |
Last Revised Date: April 23, 2015
Tags: exception

While changing the DataSource in the ComboBox cell, a null reference exception is raised. This is because the database is updated and then refreshed after you pick a value from a ComboBox cell by using the RecordValueChanged event. The newly edited value is not committed while the database updates. So, when you try to click on the next row, the RecordValueChanged event refreshes the database before the ComboBox commits the new value into the underlying database.



Figure 1: Null reference exception

This can be solved by calling the EndEdit() in the TableControlCurrentCellCloseDropDown event. Refer to the following code example.




Sample Links:

C#: ChangingDataSource-C#

VB: ChangingDataSource-VB

You must log in to leave a comment

Please sign in to access our KB

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon