I have a ultrawingrid bound to ultradatasource (version 2020.1)
The grid is multiband (depth 2). In band1 users can go into edit mode pressing digit or letter key. Edit Mode is startet in KeyPress-Event if pressed key is digit or letter.
Problem: If user press DEL-Key, the cell text of the active cell gets deleted. How I can trap the DEL-Key? If cell-text is deleted I should do some depending action in related data.
I have tried KeyDown, KeyPress, BeforeCellUpdate, AfterCellUpdate but none of these events gets raised.
Grid InitializeLayout:
e.Layout.Override.AllowAddNew = AllowAddNew.No; e.Layout.Override.AllowUpdate = Infragistics.Win.DefaultableBoolean.False; e.Layout.Override.AllowDelete = Infragistics.Win.DefaultableBoolean.False;
e.Layout.Override.SelectTypeCol = SelectType.None; e.Layout.Override.SelectTypeRow = SelectType.None; e.Layout.Override.SelectTypeCell = SelectType.None;
e.Layout.Override.CellClickAction = CellClickAction.CellSelect; e.Layout.Override.HeaderClickAction = HeaderClickAction.Select;
Band 1
band1.Override.CellMultiLine = DefaultableBoolean.True;
band1.Override.SelectTypeCell = SelectType.Extended;
any ideas how to capture the DEL-Key?
The Del key (and other non-visible keys) are not raise the KeyPress event. But they do raise KeyDown and KeyUp events.
If these events are not firing on your grid, then something else is trapping and handling those keys before they get to the grid. The most common culprit in that scenario is a toolbar.
If you have a ToolStrip or an UltraToolbarsManager and you have a Del menu option that uses the Del key as a shortcut, then that toolbar menu item will get first crack at the Del key and it will handle it in the Toolclick event and it will not fire KeyDown or KeyUp on the active control since the key was handled.
Thats it Mike!
I have found a toolbar manager tool defined shortcut. Pressing the DEL-Key the ToolbarsManager_Toolclick event is called.
Thank you.
Markus