12-15-2016 10:37 AM - edited 02-03-2024 8:10 PM
I have a Grid on a custom form, where the user should add and delete rows before processing the results (I used a DataTable for datasource). I could create the row adding functionality, but the delete action won't persists to the DataTable.
I enabled the right click 'delete row' menu (id: 1293), and If the user press it, it deletes the row visually, but the row won't get deleted from the DataTable.
I tried to handle the event, when the delete row is pressed, after the press, I could delete the row from the datatable manually, but If I catch a MenuEvent (Menu Click, MenuID check), I won't have a "row" parameter, so I don't know which row to delete. The grid is also missing such an event (OnRowDelete or similar).
How can I persists the delete action to the Grid?
(I am using SAP 9.2 with UI and DI API C#)
Hi Szabolcs,
In this case you need to combine the RightClickEvent. When the user execute a right click action you receive this event with a parameter of the type ContextMenuInfo in this parameter you can see the ItemUID and colUID, so, keep the values in a global variable and then use this values on your menu event.
The flow is the following:
Hope it helps.
Kind Regards,
Diego Lother
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Szabolcs,
There are two other alternatives.
1. Force the user to select a line before allowing the menu action to be handled (you can check during the menu event if lines are selected)
2. Check if a cell has focus using the CommonSettings and use it's row index (does not work for completely disabled grids).
The third option is what Diego suggested with globals.
Pedro Magueija
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
103 | |
12 | |
11 | |
6 | |
5 | |
4 | |
3 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.