This is a migrated thread and some comments may be shown as answers.

RadTreeView - Problem when is applied filter

2 Answers 125 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Henrique
Top achievements
Rank 1
Henrique asked on 19 Jan 2017, 06:32 PM
Dear Support Team,

We are using a RadTreeView and we found a problem.

When is applied the filter with some text and after is deleted the filter text,
the 'status mode' of some nodes is changed getting the wrong state.

Please run the attached program and following the steps below:

1- Uncheck some child nodes
2- Apply the filter with some text
3- Delete filter text

How can we solve this issue? Could you advise?

Thanks in advance!

Best regards,

Maurer

2 Answers, 1 is accepted

Sort by
0
Henrique
Top achievements
Rank 1
answered on 19 Jan 2017, 06:38 PM

Code bellow:

 

using System;
using System.Collections.Generic;
using System.Windows.Forms;
using Telerik.WinControls.Enumerations;
using Telerik.WinControls.UI;

namespace RadTreeViewFiltredTest
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

       
        private void Form1_Load(object sender, EventArgs e)
        {

            radTreeView1.CheckBoxes = true;
            radTreeView1.TriStateMode = true;

            var rootNode = new RadTreeNode("Root Node");
            
            radTreeView1.Nodes.Add(rootNode);

            // Create two parent nodes
            var parentNode1 = new RadTreeNode("First Parent");
            var parentNode2 = new RadTreeNode("Second Parent");

            // Add the parent nodes to tree view's nodes collection
            rootNode.Nodes.AddRange(parentNode1, parentNode2);
            
            
            // Create a child node
            var radTreeNodes2 = new List<RadTreeNode>
            {
                new RadTreeNode("nA.1"),
                new RadTreeNode("nB.2"),
                new RadTreeNode("nC.3"),
                new RadTreeNode("nD.4"),
                new RadTreeNode("nE.5"),
            };
            
            var radTreeNodes = new List<RadTreeNode>
            {
                new RadTreeNode("nA.1"),
                new RadTreeNode("nB.2"),
                new RadTreeNode("nC.3"),
                new RadTreeNode("nD.4"),
                new RadTreeNode("nE.5"),
            };
            
            // Add the child node to the first parent's nodes collection
            parentNode1.Nodes.AddRange(radTreeNodes);
           
            // Remove the child from the first parent collection and add it to the second parent nodes collection
            //parentNode1.Nodes.Remove(childNode);
            parentNode2.Nodes.AddRange(radTreeNodes2);
            rootNode.ExpandAll();
            rootNode.Checked = true;

        }

        private void textBox1_TextChanged(object sender, EventArgs e)
        {
            radTreeView1.Filter = textBox1.Text;

            if(radTreeView1.TopNode != null)
                radTreeView1.TopNode.ExpandAll();
        }
    }
}

0
Accepted
Hristo
Telerik team
answered on 23 Jan 2017, 05:14 PM
Hello Henrique,

Thank you for writing.

Indeed the observed behavior is not correct and I have logged an issue on our feedback portal, here: FIX. RadTreeView - incorrect check state when the control is in TriState and applying a filter. I have also added a vote for it on your behalf, as well as I have updated your Telerik points. Additionally, you can subscribe to the item and be updated with all of its status changes.

The item is already in development and the fix will be made publicly available with our next official release.

I hope this helps. Should you have further questions please do not hesitate to write back.

Regards,
Hristo
Telerik by Progress
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
General Discussions
Asked by
Henrique
Top achievements
Rank 1
Answers by
Henrique
Top achievements
Rank 1
Hristo
Telerik team
Share this question
or