On Fri, 2006-04-21 at 15:01 +0200, Philip Van Hoof wrote: > Please take a look:
> https://svn.cronos.be/svn/GtkSharpMvc/trunk/ > http://pvanhoof.be/blog/index.php/2006/04/21/databinding-an-ilist-as-datasource-for-the-gtktreeview Also note that this Gtk.Mvc.ListAdaptor can (with some adaptations) can probably also be used for the Gtk.ComboBox and other libgtk views that use the C GtkTreeModelIface GTypeInterface struct. This doesn't implement a full ComponentModel environment (like SWF has). But it might open discussions and further experiments for getting true databinding in GtkSharp working. I don't see how the SWF ComponentModel doesn't use at least a little bit reflection for making the column.MappingName = "Property" working on DataGridTextBoxColumn's http://msdn2.microsoft.com/en-us/library/system.web.ui.webcontrols.datagridcolumn(VS.80).aspx My implementation basically assumes the IList is a homogeneous list of objects that implement that property some way or another. As I cache the PropertyInfo instance, I'm not even sure it will work on a non homogeneous list where the property is enforced by an interface. But not caching the PropertyInfo would mean asking the reflection engine for that PropertyInfo on for all items the view will show (this is slower). ps. I basically need a pi.GetValue (instance, null) and a pi.SetValue (instance, value, null) where it would be nice if that "pi" can be cached. I'd need to search for the interface type to get the pi from, perhaps? I can't spend extremely huge amounts of time on it. Perhaps working on all this is a fun task for a summer-of-code google student? It's just an idea of course. -- Philip Van Hoof, software developer at x-tend home: me at pvanhoof dot be gnome: pvanhoof at gnome dot org work: vanhoof at x-tend dot be http://www.pvanhoof.be - http://www.x-tend.be _______________________________________________ Gtk-sharp-list maillist - Gtk-sharp-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/gtk-sharp-list