The Syncfusion native Blazor components library offers 70+ UI and Data Viz web controls that are responsive and lightweight for building modern web apps.
.NET PDF framework is a high-performance and comprehensive library used to create, read, merge, split, secure, edit, view, and review PDF files in C#/VB.NET.
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
ADAdministrator Syncfusion Team 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
ADAdministrator Syncfusion Team February 11, 2005 03:26 PM UTC