Search code examples
c#windowsmonodevelopxamaringtk#

Print all rows in GTK Treeview Mono


I have a single-cloumn treeview in gtk# and I need to get all values from the rows on my treeview

myTreeView.AppendColumn ("Path", new CellRendererText (), "text", 0);
myTreeView.Model = new ListStore (typeof(string));

Is there a way to iterate on each row and get the row value?


Solution

  • I used this and it worked ok for me.

    TreeIter iter;
    myTreeView.GetIterFirst(out iter);
    for (int i = 0; i < myTreeView.IterNChildren(); i++)
    {
        myTreeView.GetValue(iter, ... );
        //Do stuff.  
        myTreeView.IterNext(ref iter);   
    }