I have a simple question which i am not able to solve myself.
I have an ObjectListView filled with some of my objects. But in addition to that I want to have another column, with a default text "Delete". On clicking that column, the selected Row should be deleted. How do I do that?
If the "Delete" column is not the first column in the
ObjectListView
, you will have to setSee also ObjectListView show icons.
You can achieve this by making the desired row editable and use the CellEditActivation event. Initialize your OLV and "delete-column" as follows:
Then you can remove the row in the CellEditStarting handler as soon as the column is clicked:
To improve on this, you can display an image in addition to the text.
Result:
If you don't want to display any text next to the image you can use
You could also set the Aspect to an empty string, but consider this as "best practice". By still returning an aspect, sorting and grouping will still work.