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

Unselecting Combobox in Databound grid

Thread ID:





26810 Mar 31,2005 09:47 PM UTC Apr 1,2005 03:38 PM UTC WinForms 5
Tags: GridControl
Administrator [Syncfusion]
Asked On March 31, 2005 09:47 PM UTC

I have a databound grid control and one of the columns is a combobox that is tied to an other table. The value member is a long while the display member is a string. The column it is mapped to is a long and accepts null. If I never select anything then it will leave the value as DBNull as expected, however once you select something if you try to unselect (press the Del key) it will throw a System.Format.Exception. How can I allow the value to be unselected?

Administrator [Syncfusion]
Replied On March 31, 2005 10:53 PM UTC

Are you using version It seems to handle deleting a combobox cell values ok for me in the sample that is in this thread. http://www.syncfusion.com/Support/Forums/message.aspx?MessageID=26582

Administrator [Syncfusion]
Replied On March 31, 2005 11:03 PM UTC

Yes I am using 3.0. The gridboundcolumn is mapped to a datatable with a display tied to a varchar and a valuemember tied to a long. This is referenced back to the grids table using the mapping column field. That field allows null values. When I come in the combobox is empty and when I accept the data the field is set to DBNull, however after selecting a value from the dropdown (exclusive mode) and then selecting the field and pressing the delete key then exiting the column the attached exception is thrown. error_5737.zip

Administrator [Syncfusion]
Replied On March 31, 2005 11:39 PM UTC

Is both the value column in the grid''s data source and the value column in the combobox''s datasource longs? If one is long and one is int, then you might get the exception ytou show. Here is a sample that uses a long value member in a exclusive combobox. It allows you to delete an entry in the column. http://www.syncfusion.com/Support/user/uploads/GDBG_Combo_ArrayList_76ffeeab.zip

Administrator [Syncfusion]
Replied On April 1, 2005 03:12 PM UTC

By explicitly setting the CellValueType to Int64 the problem goes away. Thanks. By the way do you ever sleep?

Administrator [Syncfusion]
Replied On April 1, 2005 03:38 PM UTC

Too much. :)


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

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