[Gtk-sharp-list] CellRendererCombo

Fredrik Nilsson jymdman at gmail.com
Wed May 10 18:12:39 EDT 2006


Hi list,

Trying to use a CellRendererCombo in a treeview.
Everything works fine, but how can I retrive a value from a column 
different from the one defined by TextColumn??
My ListStore holds two values: an id from a database and a string.
TextColumn points to the string (col 1), but I want to know the id (col 0).

I setup the combo like this:

    cellmodel = new ListStore (typeof (long), typeof (string));
    CellRendererCombo comb = new CellRendererCombo ();
    comb.Editable = true;
    comb.Model = cellmodel;
    comb.TextColumn = 1;
    comb.HasEntry = false;
    comb.Edited += OnStarttidEdited;

    treeview.AppendColumn ("Starttid", comb, "text", 2);



In OnStarttiderEdited event I want to know the value of column 0 (the id 
(long)) in cellmodel.
Is this something I can do??

/Fredrik




More information about the Gtk-sharp-list mailing list