Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: Node Control Button Invisible  (Read 268 times)

0 Members and 1 Guest are viewing this topic.

davidacarter1984

  • Newbie
  • *
  • Offline Offline
  • Posts: 11
Node Control Button Invisible
« on: November 24, 2011, 01:34:41 PM »
Hi there.

I have followed the knowledgebase instructions to add a button in a column on my treeview and the nodes where the button should appear have changed in size but the button just does not appear. Help please

My company is the licence holder, I am the only developer.

Ruslan

  • Flexible TreeView Team
  • Hero Member
  • *****
  • Offline Offline
  • Posts: 569
Re: Node Control Button Invisible
« Reply #1 on: November 24, 2011, 02:10:35 PM »
Hello,

What is your company e-mail registered with us?
Please attach a sample project with your code to know how you add node controls and nodes. Also, what you need to accomplish in the treeview (clear goal)?

davidacarter1984

  • Newbie
  • *
  • Offline Offline
  • Posts: 11
Re: Node Control Button Invisible
« Reply #2 on: November 24, 2011, 02:27:42 PM »
Code: [Select]
foreach (var orderline in orderlines)
                    {
                        Button viewButton = new Button();
                        OrderLineNode child = new OrderLineNode(order.Key.Ref + " " + orderline.Key.Dept);
                        child.Depot = orderline.Key.Dept;
                        child.PODSize = orderline.Key.size/1024;
                        child.PODscheck = (orderline.Key.POD != null);
                        child.Remainingcheck = (orderline.Key.POD == null);
                        child.Sentcheck = (orderline.Key.SendDate != "");
                        if (child.PODscheck)
                        {
                            pods++;
                           
                            viewButton.Text = "View";
                            child.Container = new ControlContainer(viewButton);
                            viewButton.Click += new EventHandler(viewButton_Click);
                        }
                       
                        if (child.Remainingcheck)
                        { rema++;  }
                       
                        if (child.Sentcheck)
                        { sent++;  }
                       
                       

                        child.AttachTo(node);
                       
                    }

Code: [Select]
public class OrderLineNode : NodeWithControl

    {
        public string Depot { get; set; }
        public bool PODscheck { get; set; }
        public bool Remainingcheck { get; set; }
        public bool Sentcheck { get; set; }
        public double? PODSize { get; set; }

        public OrderLineNode(string pText)
            : base (pText)
        {

        }
    }
« Last Edit: November 25, 2011, 12:03:16 PM by Ruslan »

Ruslan

  • Flexible TreeView Team
  • Hero Member
  • *****
  • Offline Offline
  • Posts: 569
Re: Node Control Button Invisible
« Reply #3 on: November 24, 2011, 02:51:27 PM »
Thank you. Also please post your tree`s design code (columns if any, etc.).

davidacarter1984

  • Newbie
  • *
  • Offline Offline
  • Posts: 11
Re: Node Control Button Invisible
« Reply #4 on: November 24, 2011, 05:29:44 PM »
Code: [Select]
ARMSoft.FlexibleTreeView.Column.TreeColumn treeColumn12 = new ARMSoft.FlexibleTreeView.Column.TreeColumn();
            ARMSoft.FlexibleTreeView.Column.TreeColumn treeColumn13 = new ARMSoft.FlexibleTreeView.Column.TreeColumn();
            ARMSoft.FlexibleTreeView.Column.TreeColumn treeColumn14 = new ARMSoft.FlexibleTreeView.Column.TreeColumn();
            ARMSoft.FlexibleTreeView.Column.TreeColumn treeColumn15 = new ARMSoft.FlexibleTreeView.Column.TreeColumn();
            ARMSoft.FlexibleTreeView.Column.TreeColumn treeColumn16 = new ARMSoft.FlexibleTreeView.Column.TreeColumn();
            ARMSoft.FlexibleTreeView.Column.TreeColumn treeColumn17 = new ARMSoft.FlexibleTreeView.Column.TreeColumn();
            ARMSoft.FlexibleTreeView.Column.TreeColumn treeColumn18 = new ARMSoft.FlexibleTreeView.Column.TreeColumn();
            ARMSoft.FlexibleTreeView.Column.TreeColumn treeColumn19 = new ARMSoft.FlexibleTreeView.Column.TreeColumn();
            ARMSoft.FlexibleTreeView.Column.TreeColumn treeColumn20 = new ARMSoft.FlexibleTreeView.Column.TreeColumn();
            ARMSoft.FlexibleTreeView.Column.TreeColumn treeColumn21 = new ARMSoft.FlexibleTreeView.Column.TreeColumn();
            ARMSoft.FlexibleTreeView.Column.TreeColumn treeColumn22 = new ARMSoft.FlexibleTreeView.Column.TreeColumn();

 this.nodeTextBox7 = new ARMSoft.FlexibleTreeView.NodeControls.NodeTextBox();
            this.nodeTextBox1 = new ARMSoft.FlexibleTreeView.NodeControls.NodeTextBox();
            this.nodeTextBox2 = new ARMSoft.FlexibleTreeView.NodeControls.NodeTextBox();
            this.nodeTextBox3 = new ARMSoft.FlexibleTreeView.NodeControls.NodeTextBox();
            this.nodeTextBox4 = new ARMSoft.FlexibleTreeView.NodeControls.NodeTextBox();
            this.nodeTextBox5 = new ARMSoft.FlexibleTreeView.NodeControls.NodeTextBox();
            this.nodeTextBox6 = new ARMSoft.FlexibleTreeView.NodeControls.NodeTextBox();
            this.nodeCheckBox1 = new ARMSoft.FlexibleTreeView.NodeControls.NodeCheckBox();
            this.nodeCheckBox2 = new ARMSoft.FlexibleTreeView.NodeControls.NodeCheckBox();
            this.nodeCheckBox3 = new ARMSoft.FlexibleTreeView.NodeControls.NodeCheckBox();
            this.nodeTextBox8 = new ARMSoft.FlexibleTreeView.NodeControls.NodeTextBox();
            this.nodeTextBox9 = new ARMSoft.FlexibleTreeView.NodeControls.NodeTextBox();
            this.nodeTextBox10 = new ARMSoft.FlexibleTreeView.NodeControls.NodeTextBox();
            this.nodeControlContainer1 = new ARMSoft.FlexibleTreeView.NodeControls.NodeControlContainer();
//
            // flexibleTreeView1
            //
            treeColumn12.Id = 0;
            treeColumn12.MaxWidth = 150;
            treeColumn12.MinWidth = 100;
            treeColumn12.Name = "treeColumn0";
            treeColumn12.Text = "Date";
            treeColumn12.Width = 150;
            treeColumn13.Id = 1;
            treeColumn13.MaxWidth = 300;
            treeColumn13.MinWidth = 150;
            treeColumn13.Name = "treeColumn1";
            treeColumn13.Text = "Name / Dept";
            treeColumn13.Width = 200;
            treeColumn14.Id = 9;
            treeColumn14.Name = "treeColumn9";
            treeColumn14.Text = "Depot";
            treeColumn15.Id = 5;
            treeColumn15.Name = "treeColumn5";
            treeColumn15.Text = "Order No.";
            treeColumn15.Width = 70;
            treeColumn16.Id = 6;
            treeColumn16.Name = "treeColumn6";
            treeColumn16.Text = "Invoice No.";
            treeColumn16.Width = 70;
            treeColumn17.Id = 7;
            treeColumn17.Name = "treeColumn7";
            treeColumn17.Text = "Required";
            treeColumn18.Id = 2;
            treeColumn18.Name = "treeColumn2";
            treeColumn18.Text = "Attached";
            treeColumn19.Id = 3;
            treeColumn19.Name = "treeColumn3";
            treeColumn19.Text = "Remaining";
            treeColumn19.Width = 60;
            treeColumn20.Id = 4;
            treeColumn20.Name = "treeColumn4";
            treeColumn20.Text = "Sent";
            treeColumn21.Id = 8;
            treeColumn21.Name = "treeColumn8";
            treeColumn21.Text = "File Size";
            treeColumn22.Clickable = false;
            treeColumn22.Dragable = false;
            treeColumn22.Id = 10;
            treeColumn22.Name = "treeColumn10";
            treeColumn22.ShowInContextMenu = false;
            treeColumn22.Sortable = false;
            treeColumn22.Text = "";
            treeColumn22.Width = 150;
            this.flexibleTreeView1.Columns.Add(treeColumn12);
            this.flexibleTreeView1.Columns.Add(treeColumn13);
            this.flexibleTreeView1.Columns.Add(treeColumn14);
            this.flexibleTreeView1.Columns.Add(treeColumn15);
            this.flexibleTreeView1.Columns.Add(treeColumn16);
            this.flexibleTreeView1.Columns.Add(treeColumn17);
            this.flexibleTreeView1.Columns.Add(treeColumn18);
            this.flexibleTreeView1.Columns.Add(treeColumn19);
            this.flexibleTreeView1.Columns.Add(treeColumn20);
            this.flexibleTreeView1.Columns.Add(treeColumn21);
            this.flexibleTreeView1.Columns.Add(treeColumn22);
            this.flexibleTreeView1.Cursor = System.Windows.Forms.Cursors.Arrow;
            this.flexibleTreeView1.Dock = System.Windows.Forms.DockStyle.Fill;
            this.flexibleTreeView1.Location = new System.Drawing.Point(0, 0);
            this.flexibleTreeView1.Name = "flexibleTreeView1";
            this.flexibleTreeView1.NodeControls.Add(this.nodeTextBox7);
            this.flexibleTreeView1.NodeControls.Add(this.nodeTextBox1);
            this.flexibleTreeView1.NodeControls.Add(this.nodeTextBox2);
            this.flexibleTreeView1.NodeControls.Add(this.nodeTextBox3);
            this.flexibleTreeView1.NodeControls.Add(this.nodeTextBox4);
            this.flexibleTreeView1.NodeControls.Add(this.nodeTextBox5);
            this.flexibleTreeView1.NodeControls.Add(this.nodeTextBox6);
            this.flexibleTreeView1.NodeControls.Add(this.nodeCheckBox1);
            this.flexibleTreeView1.NodeControls.Add(this.nodeCheckBox2);
            this.flexibleTreeView1.NodeControls.Add(this.nodeCheckBox3);
            this.flexibleTreeView1.NodeControls.Add(this.nodeTextBox8);
            this.flexibleTreeView1.NodeControls.Add(this.nodeTextBox9);
            this.flexibleTreeView1.NodeControls.Add(this.nodeTextBox10);
            this.flexibleTreeView1.NodeControls.Add(this.nodeControlContainer1);
            this.flexibleTreeView1.Size = new System.Drawing.Size(1143, 655);
            this.flexibleTreeView1.TabIndex = 0;
            this.flexibleTreeView1.Text = "flexibleTreeView1";
            //
            // nodeTextBox7
            //
            this.nodeTextBox7.ColumnId = 0;
            this.nodeTextBox7.DataFieldName = "Date";
            //
            // nodeTextBox1
            //
            this.nodeTextBox1.ColumnId = 1;
            this.nodeTextBox1.DataFieldName = "Name";
            //
            // nodeTextBox2
            //
            this.nodeTextBox2.ColumnId = 5;
            this.nodeTextBox2.DataFieldName = "OrderNumber";
            //
            // nodeTextBox3
            //
            this.nodeTextBox3.ColumnId = 6;
            this.nodeTextBox3.DataFieldName = "InvoiceNumber";
            //
            // nodeTextBox4
            //
            this.nodeTextBox4.ColumnId = 2;
            this.nodeTextBox4.DataFieldName = "PODs";
            //
            // nodeTextBox5
            //
            this.nodeTextBox5.ColumnId = 3;
            this.nodeTextBox5.DataFieldName = "Remaining";
            //
            // nodeTextBox6
            //
            this.nodeTextBox6.ColumnId = 4;
            this.nodeTextBox6.DataFieldName = "Sent";
            //
            // nodeCheckBox1
            //
            this.nodeCheckBox1.ColumnId = 2;
            this.nodeCheckBox1.DataFieldName = "PODscheck";
            this.nodeCheckBox1.Editable = false;
            //
            // nodeCheckBox2
            //
            this.nodeCheckBox2.ColumnId = 3;
            this.nodeCheckBox2.DataFieldName = "Remainingcheck";
            this.nodeCheckBox2.Editable = false;
            //
            // nodeCheckBox3
            //
            this.nodeCheckBox3.ColumnId = 4;
            this.nodeCheckBox3.DataFieldName = "Sentcheck";
            this.nodeCheckBox3.Editable = false;
            //
            // nodeTextBox8
            //
            this.nodeTextBox8.ColumnId = 7;
            this.nodeTextBox8.DataFieldName = "Required";
            //
            // nodeTextBox9
            //
            this.nodeTextBox9.ColumnId = 9;
            this.nodeTextBox9.DataFieldName = "Depot";
            //
            // nodeTextBox10
            //
            this.nodeTextBox10.ColumnId = 8;
            this.nodeTextBox10.DataFieldName = "PODSize";
            //
            // nodeControlContainer1
            //
            this.nodeControlContainer1.ColumnId = 10;
            this.nodeControlContainer1.ContentAlign = System.Drawing.ContentAlignment.MiddleCenter;
            this.nodeControlContainer1.FillFreeSpace = true;
            this.nodeControlContainer1.Sortable = false;

Ruslan

  • Flexible TreeView Team
  • Hero Member
  • *****
  • Offline Offline
  • Posts: 569
Re: Node Control Button Invisible
« Reply #5 on: November 25, 2011, 11:07:53 AM »
With all this code the button is appear correctly. The only problem here maybe in this code:
Code: [Select]
                        if (child.PODscheck)
                        {
                            pods++;
                           
                            viewButton.Text = "View";
                            child.Container = new ControlContainer(viewButton);
                            viewButton.Click += new EventHandler(viewButton_Click);
                        }

If child.PODscheck will be FALSE then the button won`t be added to the node and you wouldn`t see it.

davidacarter1984

  • Newbie
  • *
  • Offline Offline
  • Posts: 11
Re: Node Control Button Invisible
« Reply #6 on: November 25, 2011, 11:49:22 AM »
in the ones where it it is true the node size increases as if to accomodate the button but i cannot see the button i have added a break point at the if statement and it runs the code inside it

Ruslan

  • Flexible TreeView Team
  • Hero Member
  • *****
  • Offline Offline
  • Posts: 569
Re: Node Control Button Invisible
« Reply #7 on: November 25, 2011, 12:06:04 PM »
Please attach the screen shot of the tree part where the button should be (scroll it to the last column with button).

davidacarter1984

  • Newbie
  • *
  • Offline Offline
  • Posts: 11
Re: Node Control Button Invisible
« Reply #8 on: November 25, 2011, 01:53:22 PM »
screenshot attached

Ruslan

  • Flexible TreeView Team
  • Hero Member
  • *****
  • Offline Offline
  • Posts: 569
Re: Node Control Button Invisible
« Reply #9 on: November 26, 2011, 06:29:13 AM »
Please check the attached sample project that uses your design code and shows the button inside a column(see the attached screenshot).
Are you got the same result?

davidacarter1984

  • Newbie
  • *
  • Offline Offline
  • Posts: 11
Re: Node Control Button Invisible
« Reply #10 on: November 26, 2011, 07:19:05 AM »
The button shows on this sample project, is there anything else which could be preventing it from being visible im using .net 4.0 full and flexibletreeview 3.3.1

Ruslan

  • Flexible TreeView Team
  • Hero Member
  • *****
  • Offline Offline
  • Posts: 569
Re: Node Control Button Invisible
« Reply #11 on: November 26, 2011, 07:36:05 AM »
The code in this sample is exactly from your messages except of adding many nodes from orderitems we add only one. Please compare it with your project, seems you didn`t send us exact code you are using. Or send us your project and we`ll find the problem.

davidacarter1984

  • Newbie
  • *
  • Offline Offline
  • Posts: 11
Re: Node Control Button Invisible
« Reply #12 on: November 26, 2011, 08:23:53 AM »
Project attached i have made a few modifications since i sent the code to you and the data is drawn from a sql database.

Ruslan

  • Flexible TreeView Team
  • Hero Member
  • *****
  • Offline Offline
  • Posts: 569
Re: Node Control Button Invisible
« Reply #13 on: November 26, 2011, 12:27:43 PM »
Thank you for the sample project, we found what caused this behavior: if node isn`t attached to the treeview all his containers are not shown in the tree. The fix will be available in the next release.

To fix it in your project now, create child nodes and add them to the parent node only after attaching parent node to the treeview:
Code: [Select]
          if ((podRec.CheckState == CheckState.Indeterminate && podSent.Checked == node.Sentcheck) |
              (podRec.Checked == node.Remainingcheck && podSent.Checked == node.Sentcheck) |
              (podRec.CheckState == CheckState.Indeterminate && podSent.CheckState == CheckState.Indeterminate) |
              (podRec.Checked == node.Remainingcheck && podSent.CheckState == CheckState.Indeterminate))
          {
            node.AttachTo(flexibleTreeView1);

            // create and attach child node here!
          }

Actually you don`t need to create child nodes if parent node won`t be added to the tree.

davidacarter1984

  • Newbie
  • *
  • Offline Offline
  • Posts: 11
Re: Node Control Button Invisible
« Reply #14 on: November 26, 2011, 01:03:48 PM »
looking at the way you structured the code wont that add the parent to the tree each time for however many child nodes there are
 

Copyright © 2006-2012 ARMSoft. All rights reserved.