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?
ADAdministrator Syncfusion Team March 31, 2005 05:53 PM
Are you using version 126.96.36.199? 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
ADAdministrator Syncfusion Team 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.
ADAdministrator Syncfusion Team 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.
ADAdministrator Syncfusion Team 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?
ADAdministrator Syncfusion Team April 1, 2005 10:38 AM