title: Monodevelop and Gtk Treeview
body: <p>I'm creating a system using monodevelop. I need to implement the Gtk TreeView to display the data. I already followed the instructions <a href="http://www.mono-project.com/GtkSharp_TreeView_Tutorial" rel="nofollow">here</a> but still, it does not work.</p>
  
  <p>My problem is I'm generating my treeview on the class. Here is my code:</p>
  
  <p>On MainWindow.cs</p>
  
  <pre><code>protected void OnShowCustomerTab (object sender, System.EventArgs e)
  {
      customer.treeViewTable(customerTreeView);
  }
  </code></pre>
  
  <p>On my class</p>
  
  <pre><code>public void treeViewTable(Gtk.TreeView tree)
      {
          tree = new Gtk.TreeView();
          tree.Hide();
  
          // generate tree column
          Gtk.TreeViewColumn lineNoColumn = new Gtk.TreeViewColumn();
          Gtk.CellRendererText lineNoCell = new Gtk.CellRendererText();
          lineNoColumn.Title = "#";
          lineNoColumn.PackStart(lineNoCell, true);
          lineNoColumn.AddAttribute(lineNoCell, "text", 0);
  
          Gtk.TreeViewColumn customerCodeColumn = new Gtk.TreeViewColumn();
          Gtk.CellRendererText customerCodeCell = new Gtk.CellRendererText();
          customerCodeColumn.Title = "Customer Code";
          customerCodeColumn.PackStart(customerCodeCell, true);
          customerCodeColumn.AddAttribute(customerCodeCell, "text", 1);
  
          // append the column and data on the tree table
          tree.AppendColumn(lineNoColumn);
          tree.AppendColumn(customerCodeColumn);
  
          tree.Show();
      }
  </code></pre>
  
  <p>Is there a problem in my code? Please help. Thanks in advance.</p>