Node changed IsChecked state itself after Scroll

2 posts, 0 answers
  1. Thomas
    Thomas avatar
    22 posts
    Member since:
    Oct 2012

    Posted 27 Mar 2013 Link to this post

    I create tree with nodes like in example. When I use scroll on mouse for scrolling up and down Node18 state changed from checked to unchecked and back on GUI. When Nodes18 state is unchecked and I select any node, Node18 state changed to checked on GUI. This is easy to reproduce. I use 2013 Q1 SP1. This code was generated by VS automatically.

     

    How do you suggest resolving this?

     

    Code example:

        

    private void InitializeComponent()
    {
      Telerik.WinControls.UI.RadTreeNode radTreeNode1 = new Telerik.WinControls.UI.RadTreeNode();
      Telerik.WinControls.UI.RadTreeNode radTreeNode2 = new Telerik.WinControls.UI.RadTreeNode();
      Telerik.WinControls.UI.RadTreeNode radTreeNode3 = new Telerik.WinControls.UI.RadTreeNode();
      Telerik.WinControls.UI.RadTreeNode radTreeNode4 = new Telerik.WinControls.UI.RadTreeNode();
      Telerik.WinControls.UI.RadTreeNode radTreeNode5 = new Telerik.WinControls.UI.RadTreeNode();
      Telerik.WinControls.UI.RadTreeNode radTreeNode6 = new Telerik.WinControls.UI.RadTreeNode();
      Telerik.WinControls.UI.RadTreeNode radTreeNode7 = new Telerik.WinControls.UI.RadTreeNode();
      Telerik.WinControls.UI.RadTreeNode radTreeNode8 = new Telerik.WinControls.UI.RadTreeNode();
      Telerik.WinControls.UI.RadTreeNode radTreeNode9 = new Telerik.WinControls.UI.RadTreeNode();
      Telerik.WinControls.UI.RadTreeNode radTreeNode10 = new Telerik.WinControls.UI.RadTreeNode();
      Telerik.WinControls.UI.RadTreeNode radTreeNode11 = new Telerik.WinControls.UI.RadTreeNode();
      Telerik.WinControls.UI.RadTreeNode radTreeNode12 = new Telerik.WinControls.UI.RadTreeNode();
      Telerik.WinControls.UI.RadTreeNode radTreeNode13 = new Telerik.WinControls.UI.RadTreeNode();
      Telerik.WinControls.UI.RadTreeNode radTreeNode14 = new Telerik.WinControls.UI.RadTreeNode();
      Telerik.WinControls.UI.RadTreeNode radTreeNode15 = new Telerik.WinControls.UI.RadTreeNode();
      Telerik.WinControls.UI.RadTreeNode radTreeNode16 = new Telerik.WinControls.UI.RadTreeNode();
      Telerik.WinControls.UI.RadTreeNode radTreeNode17 = new Telerik.WinControls.UI.RadTreeNode();
      Telerik.WinControls.UI.RadTreeNode radTreeNode18 = new Telerik.WinControls.UI.RadTreeNode();
      Telerik.WinControls.UI.RadTreeNode radTreeNode19 = new Telerik.WinControls.UI.RadTreeNode();
      Telerik.WinControls.UI.RadTreeNode radTreeNode20 = new Telerik.WinControls.UI.RadTreeNode();
      Telerik.WinControls.UI.RadTreeNode radTreeNode21 = new Telerik.WinControls.UI.RadTreeNode();
      Telerik.WinControls.UI.RadTreeNode radTreeNode22 = new Telerik.WinControls.UI.RadTreeNode();
      Telerik.WinControls.UI.RadTreeNode radTreeNode23 = new Telerik.WinControls.UI.RadTreeNode();
      this.radTreeView1 = new Telerik.WinControls.UI.RadTreeView();
      ((System.ComponentModel.ISupportInitialize)(this.radTreeView1)).BeginInit();
      this.SuspendLayout();
      //
      // radTreeView1
      //
      this.radTreeView1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
            | System.Windows.Forms.AnchorStyles.Left)
            | System.Windows.Forms.AnchorStyles.Right)));
      this.radTreeView1.BackColor = System.Drawing.SystemColors.Control;
      this.radTreeView1.Cursor = System.Windows.Forms.Cursors.Default;
      this.radTreeView1.Font = new System.Drawing.Font("Segoe UI", 8.25F);
      this.radTreeView1.ForeColor = System.Drawing.Color.Black;
      this.radTreeView1.Location = new System.Drawing.Point(12, 12);
      this.radTreeView1.Name = "radTreeView1";
      radTreeNode1.Expanded = true;
      radTreeNode1.Name = "Node1";
      radTreeNode2.Name = "Node2";
      radTreeNode2.Text = "Node2";
      radTreeNode3.Name = "Node3";
      radTreeNode3.Text = "Node3";
      radTreeNode4.Name = "Node4";
      radTreeNode4.Text = "Node4";
      radTreeNode5.Name = "Node5";
      radTreeNode5.Text = "Node5";
      radTreeNode6.Name = "Node6";
      radTreeNode6.Text = "Node6";
      radTreeNode7.Name = "Node7";
      radTreeNode7.Text = "Node7";
      radTreeNode8.Name = "Node8";
      radTreeNode8.Text = "Node8";
      radTreeNode9.Name = "Node9";
      radTreeNode9.Text = "Node9";
      radTreeNode10.Name = "Node10";
      radTreeNode10.Text = "Node10";
      radTreeNode11.Name = "Node11";
      radTreeNode11.Text = "Node11";
      radTreeNode12.Name = "Node12";
      radTreeNode12.Text = "Node12";
      radTreeNode13.Name = "Node13";
      radTreeNode13.Text = "Node13";
      radTreeNode14.Name = "Node14";
      radTreeNode14.Text = "Node14";
      radTreeNode15.Name = "Node15";
      radTreeNode15.Text = "Node15";
      radTreeNode1.Nodes.AddRange(new Telerik.WinControls.UI.RadTreeNode[] {
            radTreeNode2,
            radTreeNode3,
            radTreeNode4,
            radTreeNode5,
            radTreeNode6,
            radTreeNode7,
            radTreeNode8,
            radTreeNode9,
            radTreeNode10,
            radTreeNode11,
            radTreeNode12,
            radTreeNode13,
            radTreeNode14,
            radTreeNode15});
      radTreeNode1.Text = "Node1";
      radTreeNode16.Expanded = true;
      radTreeNode16.Name = "Node16";
      radTreeNode17.CheckType = Telerik.WinControls.UI.CheckType.RadioButton;
      radTreeNode17.Name = "Node17";
      radTreeNode17.Text = "Node17";
      radTreeNode18.CheckState = Telerik.WinControls.Enumerations.ToggleState.Indeterminate;
      radTreeNode18.CheckType = Telerik.WinControls.UI.CheckType.RadioButton;
      radTreeNode18.Expanded = true;
      radTreeNode18.Name = "Node18";
      radTreeNode19.CheckType = Telerik.WinControls.UI.CheckType.CheckBox;
      radTreeNode19.Name = "Node19";
      radTreeNode19.Text = "Node19";
      radTreeNode20.CheckType = Telerik.WinControls.UI.CheckType.CheckBox;
      radTreeNode20.Name = "Node20";
      radTreeNode20.Text = "Node20";
      radTreeNode21.CheckType = Telerik.WinControls.UI.CheckType.CheckBox;
      radTreeNode21.Name = "Node21";
      radTreeNode21.Text = "Node21";
      radTreeNode22.CheckType = Telerik.WinControls.UI.CheckType.CheckBox;
      radTreeNode22.Name = "Node22";
      radTreeNode22.Text = "Node22";
      radTreeNode23.CheckType = Telerik.WinControls.UI.CheckType.CheckBox;
      radTreeNode23.Name = "Node23";
      radTreeNode23.Text = "Node23";
      radTreeNode18.Nodes.AddRange(new Telerik.WinControls.UI.RadTreeNode[] {
            radTreeNode19,
            radTreeNode20,
            radTreeNode21,
            radTreeNode22,
            radTreeNode23});
      radTreeNode18.Text = "Node18";
      radTreeNode16.Nodes.AddRange(new Telerik.WinControls.UI.RadTreeNode[] {
            radTreeNode17,
            radTreeNode18});
      radTreeNode16.Text = "Node16";
      this.radTreeView1.Nodes.AddRange(new Telerik.WinControls.UI.RadTreeNode[] {
            radTreeNode1,
            radTreeNode16});
      this.radTreeView1.RightToLeft = System.Windows.Forms.RightToLeft.No;
      this.radTreeView1.Size = new System.Drawing.Size(260, 238);
      this.radTreeView1.SpacingBetweenNodes = -1;
      this.radTreeView1.TabIndex = 0;
      this.radTreeView1.Text = "radTreeView1";
      //
      // Form1
      //
      this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
      this.ClientSize = new System.Drawing.Size(284, 262);
      this.Controls.Add(this.radTreeView1);
      this.Name = "Form1";
      this.Text = "Form1";
      ((System.ComponentModel.ISupportInitialize)(this.radTreeView1)).EndInit();
      this.ResumeLayout(false);
     
    }
     
    private Telerik.WinControls.UI.RadTreeView radTreeView1;

     

    UPDATE : This causes for node18 because it set as 
    radTreeNode18.CheckState = Telerik.WinControls.Enumerations.ToggleState.Indeterminate;

  2. Julian Benkov
    Admin
    Julian Benkov avatar
    1135 posts

    Posted 29 Mar 2013 Link to this post

    Hello Thomas,

    In the provided example the Node18 is setup to RadioButton check type. To use the CheckBox in TriState mode you must change the
    CheckType of node to CheckBox:
    radTreeNode18.CheckType = Telerik.WinControls.UI.CheckType.CheckBox;

    If you want the changing of CheckType to be not controlled by the default parent / child logic for related Nodes you must setup the AutoCheckChildNodes property to false.
    radTreeView1.AutoCheckChildNodes = false;

    I hope this helps.

    Greetings,
    Julian Benkov
    the Telerik team
    WinForms Q1 2013 boasts PivotGrid, PDF Viewer, Chart enhancements and more. Check out all of the latest highlights.
  3. UI for WinForms is Visual Studio 2017 Ready
Back to Top