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

Ганьков Андрей gankov.andrey at inbox.ru
Wed Sep 18 22:01:42 UTC 2013


18.09.2013 19:41, jaymarvels пишет:
> 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.
> _______________________________________________
> Gtk-sharp-list maillist  -  Gtk-sharp-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/gtk-sharp-list
>
>
I think you need add to end
teamListView.ShowAll();

-- 
Andrey Gankov
Mail:gankov.andrey at inbox.ru
ICQ: 230-684-976
Jabber:gankov at jabber.ru



More information about the Gtk-sharp-list mailing list