[Gtk-sharp-list] get value of a cell

Michael Hutchinson m.j.hutchinson at gmail.com
Fri May 22 16:22:45 EDT 2009

On Fri, May 22, 2009 at 3:53 PM, herrhund <hans at hparis.com> wrote:
> Hello,
> I have a treeview and need to get the value of a cell when the users click
> on it. I'm trying to get it using the RowActivated event but can't figure
> how! I was able to get the column title and the row index, but not the cell
> value. Any help would be really appreciated. :)

A column can contain multiple cells, and these cells can have multiple
model columns mapped to their properties, so there isn't a 1:1
correspondence. You'll need to write some logic to reverse the mapping
you set up, e.g.

if (args.Column == nameColumn)
    value = model.GetValue (row, nameModelColumnIndex);

Michael Hutchinson

More information about the Gtk-sharp-list mailing list