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 in dropdown

Hi,

I have a grid with a dropdown.

The list that I bind to the dropdowns does not contain null but the object that I bind to the grid does (only at the beginning since the user haven't chosen a value).

The ID in the object is a Nullable(Of Integer)

This gives me a lot of

System.NullReferenceException: Object reference not set to an instance of an object.
at Syncfusion.Windows.Forms.Grid.GridComboBoxListBoxHelper.FindKey(IList thisList, PropertyDescriptor property, Object key)

Is there a property I can set (or something else) that will eliminate this exception?



3 Replies

NA Nisha Arockiya A Syncfusion Team March 9, 2009 11:50 AM UTC

Hi Stephane,

Thanks for your interest in Syncfusion Products.

It is hard to trace out the problem with out the working sample. Could you please reproduce the issue in a sample or provide your own working sample , so that it would be very helpful for us to fix the issue on time??

Please let me know any difficulties.

Regards,
Nisha.




S_ Stephane _ March 9, 2009 01:52 PM UTC

If you pass your mouse over the dropdown arrow when there’s no value selected, you'll see a NullReference Exception.

You won't see a messagebox, it will be in the output window in vs.




GGC_DropDownException_d29e8cac.zip


NA Nisha Arockiya A Syncfusion Team March 10, 2009 12:29 PM UTC

Hi Stephane,

Thanks for the update.

It seems that the column datatype doesn't match the cell value. You might try setting the Style.CellValueType to the desired vlauetype. (ValueMember) to see that if that helps.

The Exception that occur on the output window has been handled internally, which does not affect the process execution.
If you find it crash your sequence even now at runtime, please let me know.

Regards,
Nisha.


Loader.
Live Chat Icon For mobile
Up arrow icon