Removing multiple rows from a TreeView in mono GTK# has tripped me up a little bit lately and the answer wasn’t a quick google search away so I’m posting this question here. It has been extra problematic removing multiple rows when using sorting with the TreeView (TreeModelSort).
Share
The following function can remove multiple selected rows on a plain TreeView that doesn’t implement a fancy TreeModelSort or TreeModelFilter:
This next function can remove multiple selected rows on a TreeView that DOES implement a TreeModelSort (similar logic can be applied if your TreeView is using a TreeModelFilter):
If anyone has a better way of doing this or sees any bugs in my solution please post a fix, thanks!