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. (Last updated on : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

ListBoxSelectionMode.One/DEL key in GDBG

Thread ID:

Created:

Updated:

Platform:

Replies:

24824 Feb 11,2005 09:25 AM UTC Feb 11,2005 03:26 PM UTC WinForms 2
loading
Tags: GridControl
Administrator [Syncfusion]
Asked On February 11, 2005 09:25 AM UTC

Hi Stefan When I set the ListBoxSelectionMode.One in a GDBG, the delete key will remove the whole row. How can I change the behaviour of the del key that I''m able to delete the selected text in a grid cell while editing the cell? Regards Thomas

Administrator [Syncfusion]
Replied On February 11, 2005 12:28 PM UTC

Thomas, there are two options: 1) Set ActivateCurrentCellBehavior & GridCellActivateAction.SetCurrent) != 0) - or - 2) override HandleBoundCurrentCellKeyDown and check for e.KeyCode == Keys.Delete and don''t call base class. Right now this is the code that gets excecuted in GridDataBoundGrid.HandleBoundCurrentCellKeyDown else if (e.KeyCode == Keys.Delete) { GridRangeInfo range = Selections.Ranges.ActiveRange; if (range.IsRows || range.IsTable) { if (Model.Options.ListBoxSelectionMode != SelectionMode.None && CurrentCell.IsEditing && (Model.Options.ActivateCurrentCellBehavior & GridCellActivateAction.SetCurrent) != 0) return; if (range.IsRows) DeleteRecordsAtRowIndex(range.Top, range.Bottom); else if (range.IsTable) DeleteRecordsAtRowIndex(Binder.ListManagerPositionToRowIndex(0), Binder.ListManagerPositionToRowIndex(Binder.RecordCount-1)); e.Handled = true; } Additionally you should also handle either the OnKeyDown or OnClearingCells event for the case that you press DELETE when the current cell is not in edit mode. Stefan >Hi Stefan > >When I set the ListBoxSelectionMode.One in a GDBG, the delete key will remove the whole row. How can I change the behaviour of the del key that I''m able to delete the selected text in a grid cell while editing the cell? > >Regards >Thomas

Administrator [Syncfusion]
Replied On February 11, 2005 03:26 PM UTC

Hi Stefan, Thanks for the code. Regards, Thomas

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.

Warning Icon 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.Close Icon

;