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

Unselecting Combobox in Databound grid

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?

5 Replies

AD Administrator Syncfusion Team March 31, 2005 10:53 PM UTC

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


AD Administrator Syncfusion Team 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


AD Administrator Syncfusion Team 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


AD Administrator Syncfusion Team 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?


AD Administrator Syncfusion Team April 1, 2005 03:38 PM UTC

Too much. :)

Loader.
Up arrow icon