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.
Unfortunately, activation email could not send to your email. Please try again.

Unselecting Combobox in Databound grid

Thread ID:

Created:

Updated:

Platform:

Replies:

26810 Mar 31,2005 04:47 PM Apr 1,2005 10:38 AM Windows Forms 5
loading
Tags: GridControl
Administrator [Syncfusion]
Asked On March 31, 2005 04:47 PM

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 05:53 PM

Are you using version 3.0.1.0? 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 06:03 PM

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 06:39 PM

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 10:12 AM

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 10:38 AM

Too much. :)

CONFIRMATION

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.

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.

;