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

Delete cell value in grid

I am using a databoundgrid bound to a typed dataset in VB.net. I delete the value in a cell with a calendar. When I try to move to a different cell I get an error that it cannot store the value in the bound column because it doesn''t match the datatype. When I do this in a list control the application freezes and has to be shutdown. We would like users to be able to delete an existing value in a cell. I''ve tried several ways of doing this including ClearCells, changing it directly in the dataset, etc. without success. How can we do this? Thanks!

3 Replies

Administrator February 12, 2004 03:47 PM UTC

I tried to see this problem in this sample using version 1.6.1.8, but could not. Pressing the delete key will clear the date and you can tab off without getting an exception. Can you see the problem with this code? If not, check you database to see if that date column accepts nulls.

GS Greg Shomette February 13, 2004 01:46 PM UTC

Thank-you for your reply yesterday. After a lot of trial and error I discovered that the CellValueType needs to be set to be able to successfully delete the cell value in our scenario for calendar cells and most other types of cells. However, it does not solve the issue of deleting a value in a cell with a cell type of listbox or dropdowngrid. When I do that and then try to move to another cell the application freezes up and needs to be restarted. I also noticed that deleting the visible text in these types of cells doesn''t in itself change the cell value or the display text value. I tried deal with it in the CurrentCellMoving event by seeing if GetDisplayText = string.empty, but it still held the visible string I had deleted. We would like users to be able to delete the value in a listbox cell or dropdowngrid cell. If that isn''t possible we want to at least provide other options so the application doesn''t freeze up. Thanks!

GS Greg Shomette February 13, 2004 04:53 PM UTC

I figured out the issue of deleting the value in the cell. If the gridlistcontrol is set to AutoComplete deleting the value results in a freeze. If it is set to Exclusive the dropdown list goes crazy looping through the list over and over. If it is set to Editable it works fine. I imagine it is because in the other two settings it is doing an endless loop looking for "" in the list.
Loader.
Live Chat Icon For mobile
Up arrow icon