コード例 #1
0
 private void geniusTreeView1_OnGetNodeText(Genius.Controls.TreeView.GeniusTreeView Sender, Genius.Controls.TreeView.NodeTextEventArgs e)
 {
     if (e.DisplayColumn == 2)
     {
         GroupItem item = e.Node.Data as GroupItem;
         if (item != null)
         {
             e.Text = item.value.ToString();
         }
         else
         {
             GroupTotal tot = e.Node.Data as GroupTotal;
             if (tot != null)
             {
                 e.Text = tot.value.ToString();
             }
         }
     }
 }
コード例 #2
0
 private void CustomDrawDemoCtl_Load(object sender, System.EventArgs e)
 {
     geniusTreeView1.BeginUpdate();
     try
     {
         Random r = new Random();
         for (int i = 0; i < 10; i++)
         {
             INode parent = geniusTreeView1.Add(null, "Groupe " + i.ToString(), new Group());
             parent.Height *= 2;
             geniusTreeView1.ExpandCollapseNode(parent);
             double totalValue = 0;
             for (int j = 0; j < 10; j++)
             {
                 object o     = null;
                 double value = r.NextDouble() * (r.NextDouble() * 100);
                 value       = Math.Round(value, 4);
                 totalValue += value;
                 if (j < 9)
                 {
                     o = new GroupItem();
                     ((GroupItem)o).value = value;
                 }
                 else
                 {
                     o = new GroupTotal();
                     ((GroupTotal)o).value = totalValue;
                 }
                 INode n = geniusTreeView1.Add(parent, "Node " + j.ToString(), o);
             }
         }
         geniusTreeView1.DefaultDrawingOption |= DrawingOption.HideTreeLines;
         //geniusTreeView1.DefaultDrawingOption &= (~DrawingOption.ShowHorzLines);
         geniusTreeView1.FullRowSelect = true;
     }
     finally
     {
         geniusTreeView1.EndUpdate();
     }
 }