Current filter:
                                You should refresh the page.
                                Support Center
                                  • Thank for reply Andrew. I have another problem now, though. Setting FocusedRow to null solved my problem but how can i set it to one of my objects?


                                    //This is working

                                    TreeListNode treeListNode = OrganizationalUnitTreeListView.GetNodeByKeyValue(controller.Model.ParentOrganizationalUnitKey.Value);


                                    OrganizationalUnitTreeListView.FocusedRow = treeListNode.Content;


                                    OrganizationalUnitTreeListView.FocusedRowHandle = OrganizationalUnitTreeListView.Nodes.IndexOf(treeListNode);



                                    I want to select one of my object's parent in tree but none of #1,#2,#3 methods (one by one or alltogether) works, am I doing something wrong?

                                    Also I need to support un-selecting rows. WPFToolkit datagrid is using CTRL+Left Mouse Click for this operation by default, what do you suggest for this operation?

                                You must  log in  or  register  to leave comments

                                1 Solution


                                Hi Gökçen,

                                You can set the TreeListView.FocusedRow property to an item in your collection.
                                For example :

                                public MainWindow() { InitializeComponent(); treeListView1.RootValue = Guid.Empty; coll = new ObservableCollection<MyObj>(); coll.Add(new MyObj() { Text = "aaaaaaaaaaaaaaaaaa", Number = 1, Group = "A", NodeID = 1, ParentNodeID = Guid.Empty}); coll.Add(new MyObj() { Text = "bbbbbbbbbbbbbbbbb", Number = 2, Group = "A",NodeID=2,ParentNodeID=1 }); coll.Add(new MyObj() { Text = "c", Number = 3, Group = "B",NodeID=3,ParentNodeID=1 }); coll.Add(new MyObj() { Text = "d", Number = 4, Group = "B", NodeID = 4, ParentNodeID = Guid.Empty }); coll.Add(new MyObj() { Text = "e", Number = 5, Group = "B", NodeID = 5, ParentNodeID = 4}); coll.Add(new MyObj() { Text = "f", Number = 6, Group = "B", NodeID = 6, ParentNodeID = 3}); treeListView1.ParentFieldName = "ParentNodeID"; treeListView1.KeyFieldName = "NodeID"; treeListControl1.ItemsSource = coll; treeListControl1.View.MultiSelectMode = TableViewSelectMode.None; treeListView1.FocusedRow = coll[5]; }
                                Please try this solution and let us know the results.

                                You must  log in  or  register  to leave comments

                                If you need additional product information, write to us at 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