Ok thanks. I guess that's the problem. I use a TreeModelFilter.
So I changed it to this:
klantListStore.Remove(ref filter.ConvertIterToChildIter(iterSelected));
But when I try to compile I get:
A ref or out argument must be an assignable variable(CS1510)
However, the treeModelFilter called filter is public...
countcb wrote:
The only problem i can imagine is that your assinging a TreeModelFilter or a TreeModelsort to tv_klanten.Model.
Then the selction you get when you click on the tree will be an iterator for THAT model. NOT for your listStore. Thats why your iter is not valid.
If you do like I assume you have to change the call
listStore.Remove(ref iterSelected);
to
listStore.Remove(ref subModel.ConvertIterToChildIter(iterSelected));
where "subModel" is the model you assigned to tv_klanten.Model