[Gtk-sharp-list] how can I get value in CellRendererCombo withmulticolumn Model?

Dr. McArrow dr_mcarrow at mail.ru
Mon Feb 5 11:05:07 EST 2007


Thanks for your advice.
But actually, I don't need to get value of TreeView.
in TreeView i have many columns, and one of its - CellRendererCombo.
(look at my first message.)
i need a kind of "CellRendererCombo.model.getvalue" , not  
TheTreeView.Model.GetValue,



On Mon, 05 Feb 2007 17:53:23 +0200, Luciano _ <lnc19 at hotmail.com> wrote:

> Try this:
>
> private void OnEdited(object o, EventArgs a)
> {
>    TreeIter iter;
>     if(TheTreeView.Selection.GetSelected(out iter)) // This return the  
> selected Iter
>    {
>         Console.WriteLine(TheTreeView.Model.GetValue(iter, 0)) // This  
> print the first column content
>         Console.WriteLine(TheTreeView.Model.GetValue(iter, 1)) // This  
> print the second column content
>    }
> }
>
>
>
>>
>> I have a CellRendererCombo in a treeview.
>> how can I retrive a value from a column different than the one defined  
>> by
>> TextColumn?
>> My ListStore holds two values: an id from a database and a string.
>> TextColumn points to the string (column 0), but I want to know the id  
>> (col
>> 1).
>>
>>
>> ListStore ls_dept = new ListStore(typeof(string),typeof(string));
>> ls_dept.AppendValue("sssss","1");
>> ls_dept.AppendValue("zzzzz","2")
>>
>> ...
>>
>> CellRendererCombo crc = new CellRendererCombo();
>> crc.Editable = true;
>> crc.Model = ls_dept;
>> crc.TextColumn = 0;
>> crc.Edited += (OnEdited);
>> ...
>>
>> private void OnEdited(object o, EventArgs a)
>> {
>> in this place i need to know the value of column 1.
>> how can I do this?
>> }
>>
>>
>> --
>> Dr.McArrow
>> _______________________________________________
>> Gtk-sharp-list maillist  -  Gtk-sharp-list at lists.ximian.com
>> http://lists.ximian.com/mailman/listinfo/gtk-sharp-list
>
> _________________________________________________________________
> ¿Cuánto vale tu auto? Tips para mantener tu carro. ¡De todo en MSN  
> Latino Autos! http://latino.msn.com/autos/
>



-- 
Dr.McArrow


More information about the Gtk-sharp-list mailing list