[Gtk-sharp-list] [Mono GTK#] Bind Class object to TreeView

jaymarvels jacob.spencer80 at googlemail.com
Wed Sep 18 15:41:23 UTC 2013


I've googled this for the last 5 hours and tried evey "tutorial" under the
sun that google brings back to me..

In winforms I can create a List from my class and bind that to my listview,
no problems..

In gtk# its not so simple.

I have my class, with my objects, I even have my List.

I can transfer my class into a ListStore.

I have dragged a TreeView widget into a box widget and am having really
issue's populating it.

I can't even make any headers appear when doing;


			teamListView = new Gtk.TreeView ();
			//add in cols
			Gtk.TreeViewColumn fNamecol = new Gtk.TreeViewColumn ();
			fNamecol.Title = "First Name";
			Gtk.TreeViewColumn sNamecol = new Gtk.TreeViewColumn ();
			fNamecol.Title = "Second Name";

			teamListView.AppendColumn (fNamecol);
			teamListView.AppendColumn (sNamecol);

			Gtk.ListStore nameListStore = new Gtk.ListStore (typeof(string),
typeof(string));
			teamListView.Model = nameListStore;


Its blank..nothing..i'd expect at the minimum to see 2 column headers.

Is there anyone, or anything which can give a simple step by step way of
creating a treview that shows simply 2 columns.



--
View this message in context: http://mono.1490590.n4.nabble.com/Mono-GTK-Bind-Class-object-to-TreeView-tp4660910.html
Sent from the Mono - Gtk# mailing list archive at Nabble.com.


More information about the Gtk-sharp-list mailing list