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

Setting ListBoxSelectionMode in a GridDataBoundGrid

I have a grid that is derived from a GDBG. A method is hooked to the RowsDeleting grid event in order to display a "Are you sure?" type dialog. I have used this derived grid successfully on a few dialogs with great success. We have one grid that the ListBoxSelectionMode property in set to one. One that grid, the grids RowsDeleting event is hit when the user selects the text in a TextBox and attempts to delete the text in the cell. This only happens when the ListBoxSelectionMode is set to one. Any ideas what is happening? Thanks. Ken

2 Replies

AD Administrator Syncfusion Team May 5, 2003 03:22 PM UTC

The problem is that with ListboxMode set, the row is always selected even if you are editing a cell. So, when a delete key is seen, there is a selected row, so the grid deletes it. I think this is something that is more easily fixed in our source. I'll pass the problem onto Stefan to see what he thinks. One way to work around it is to temporarily remove the selection when the delete key is pressed. You can do this in a ProcessDialogKey override. Then you could handle OnCurrentCellChanged, and re-select the row if teh selection is missing.


KJ Kenneth Johnson May 5, 2003 03:37 PM UTC

Actually, the dialog in question was not originally written by me. I was working on something else and noticed the behavior. The grid should have been extended select and I have since revised it. Just thought that you would want to know about the single select problem. Later. Ken

Loader.
Up arrow icon