Current filter:
                                You should refresh the page.
                                Support Center
                                0
                                  • Hi,
                                    I want to expand check node behaviour. When I click on Category node all children must have the same state.
                                    For this task I need to know all children nodes from category. But expected Nodes give me all category nodes not child nodes from category.
                                    Ho can I get child nodes from thd current node?

                                    protected override void RaiseAfterCheckNode(TreeListNode node)
                                    {
                                    ....
                                              //if category node
                                                    foreach (TreeListNode childNode in Nodes)
                                                    {
                                                        childNode.Checked = node.Checked;
                                                    }
                                    }

                                    Thanks Alex

                                0

                                Hi Alex ,

                                Thank you for contacting us.

                                Could you please specify which type of datasource you are using. Usually this problem occurs when TreeList is used in Virtual Mode. In this mode nodes are created only when it is necessary and it is not possible to access them if they are not created yet.

                                If it is not your case, the Nodes collection should contain all child nodes of a parent node.

                                Please provide us with more information regarding your problem and we will try to provide you with a more precise solution. If you can create a sample project illustrating the problem, this would be great.

                                Thanks
                                Dimitros

                                0

                                Hi Dimitros,
                                yes, I use virtual mode. I have only my test project and in attachment is not the last state.
                                But you can see how can I get the data
                                public class PropertyDescriptorCollectionWithColumns : PropertyDescriptorCollection, TreeList.IVirtualTreeListData
                                 
                                >it is not possible to access them if they are not created yet.
                                If I can saw the node it must be created or ...?

                                Thanks Alex

                                0

                                Hi Alex,

                                Yes, you're right. You cannot set a node's check state until it is created. In virtual mode it means that you need to expand a parent node to access its children. A solution is to traverse child nodes within the AfterExpand event handler:

                                [C#]
                                private void treeList1_AfterExpand(object sender, NodeEventArgs e) { ... foreach(TreeListNode node in e.Node.Nodes) node.CheckState = e.Node.CheckState; ... }

                                Please try this solution, and let me know your results.

                                Thanks,
                                Vlad R

                                0

                                Hi Vlad,
                                Thanks for the answer but I can't find any relation from node expand to node check.
                                Could you look at the attachment, please. I have expanded nodes.
                                We need to realize "group check" mode.
                                When I click onto Category node check box then all children must have the same state as category node.
                                When all children have the same state, then category node must have the same one.
                                If not all chilren have the same state, then category node must have the third "undefined" state.
                                Thanks Alex

                                0

                                Hi Alex,

                                Let me explain. You're using TreeList in virtual mode. In this mode TreeList nodes are created on demand when you expand them. So, if you need to set initial check state for child nodes on expanding their parent you have to do it within the AfterExpand event handler, after these nodes are physically created.
                                As for the second part of your question. The behavior you've described is known as the recursive node checking. I've created a sample demonstrating how to implement it.
                                Please try this solution and inform us of your results.

                                Thanks,
                                Vlad R

                                If you need additional product information, write to us at info@devexpress.com or call us at +1 (818) 844-3383

                                FOLLOW US

                                DevExpress engineers feature-complete Presentation Controls, IDE Productivity Tools, Business Application Frameworks, and Reporting Systems for Visual Studio, along with high-performance HTML JS Mobile Frameworks for developers targeting iOS, Android and Windows Phone. Whether using WPF, Silverlight, ASP.NET, WinForms, HTML5 or Windows 8, DevExpress tools help you build and deliver your best in the shortest time possible.

                                Copyright © 1998-2014 Developer Express Inc.
                                All trademarks or registered trademarks are property of their respective owners