[Gtk-sharp-list] Different CellRenderers in different cells

Florian Roth rothflorian at gmx.de
Sun Apr 13 15:46:50 EDT 2008

Hi all,


I have a TreeView with a ListStore as its model. The model has two columns.
It simply represents a name-value mapping. So the first column has a
CellRendererText and simply displays the name of the pair. The second column
contains the value which is a System.Object. So it can hold any data type.
Now this column shall be editable as well. Depending on the value's type it
shall use another CellRenderer.

So I implemented the CellRenderer class and delegated the call to
StartEditing to the dedicated renderer for the object in the cell. So if
it's an int I use a CellRendererSpin, for strings a CellRendererText, etc.

But unfortunately this only works for CellRendererText. All other renderers
return null when calling StartEditing.

How can I solve this problem? Is this the wrong way what I was doing? Am I
missing something?



Florian Roth

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/gtk-sharp-list/attachments/20080413/4e1f47cb/attachment.html 

More information about the Gtk-sharp-list mailing list