Current filter:
                                You should refresh the page.
                                Support Center
                                0
                                  • 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);


                                    //#1

                                    OrganizationalUnitTreeListView.FocusedRow = treeListNode.Content;

                                    //#2

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

                                    //#3

                                    OrganizationalUnitTreeListView.SelectNode(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

                                0

                                Hi Gökçen,

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

                                	
                                [C#]
                                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

                                To start a chat you should create a support ticket


                                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