« Return to Thread: Treeview, delete the selected row (can't get it done :( )

Re: Treeview, delete the selected row (can't get it done :( )

by countcb :: Rate this Message:

Reply to Author | View in Thread

Ah. sorry. My mistake.

The parameter to the remove method is passed via the ref keyword.
That means the Remove method wants to change this iter (it will set the iter to the next valid row after it deleted the row).

But we just passed a method which will return a iter. But the remove method can't assign anything to this reutn value because it not held in a variable.

So the correct way of doing it would be:

TreeIter iter = subModel.ConvertIterToChildIter(iterSelected);
listStore.Remove(ref iter);

 « Return to Thread: Treeview, delete the selected row (can't get it done :( )