<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
I think this would help.<br>
Thank you very much.<br>
<br>
Philip Van Hoof wrote:
<blockquote cite="mid:1202991016.7110.30.camel@schtrumpf" type="cite">
  <pre wrap="">On Thu, 2008-02-14 at 15:27 +0800, Marc Glenn wrote:
  </pre>
  <blockquote type="cite">
    <pre wrap="">Hello everyone,

     Does anyone know how to retrieve values currently displayed on a 
TreeView widget?

     Suppose a row entry from the TreeView was clicked, how can the the 
data in the row be retrieved?

     I checked the Mono Documentation but I can't find a method to do this.
    </pre>
  </blockquote>
  <pre wrap=""><!---->
There are a few ways, but this is one possibility:

treeview.Selection.Changed += OnSelectionChanged;

private void OnSelectionChanged; (object o, EventArgs args)
{
        Gtk.TreeSelection selection = o as Gtk.TreeSelection;
        YourColumn'sType data;
        Gtk.TreeModel model;
        Gtk.TreeIter iter;

        if (selection.GetSelected (out model, out iter)) {
                int column = YourColumnNumber;
                GLib.Value val = GLib.Value.Empty;
                model.GetValue (iter, column, ref val);
                data = (YourColumn'sType) val.Val;
                val.Dispose ();
        }
}

Advise: check out the Model View Controller pattern in detail.

Change "YourColumn'sType" into "string" in case the data is a string.


  </pre>
</blockquote>
<br>
</body>
</html>