[Gtk-sharp-list] TreeView - Hiding and resizing columns

Andrew York andy at brdstudio.net
Tue Apr 6 17:22:54 EDT 2010


On 4/6/2010 5:08 PM, fpiraneo wrote:
> Hi all,
>
> I'm showing informations retrieved from a database inside a treeview; now I
> have two questions for you:
>
> 1. How can I embed the unique id for each row displayed on the treeview...
> I'm thinking about an hidden column; do you have best ideas? Unfortunately I
> don't know how to hide columns... can someone link me to piece of code?
>    
     It's important to remember that the columns in a list store don't 
have to be referenced in the tree view. In Gtk# there is a greater 
amount of separation between the data and the display than in MS grids.
     Here is my favorite beginner tutorial 
http://www.mono-project.com/GtkSharp_TreeView_Tutorial

     Specifically I use the methods here 
http://www.mono-project.com/GtkSharp_TreeView_Tutorial#Controlling_how_the_model_is_used

     At first it seems kind of ackward using class objects to populate 
the liststore/treestore but over time is become very helpful.

> 2. As default the column are fixed width; there is any parameter to set to
> allow the user to resize the column? Again, some piece of code or links,
> please?
>    
     TreeViewColumn.Resizable = true;
> Thank you very much!
> Francesco :-)
>    
I hope this helps if it don't I'll try again.

SpoodyGoon





More information about the Gtk-sharp-list mailing list