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

RadTreeView sort arrows ?

2 Answers 87 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Barry
Top achievements
Rank 1
Barry asked on 07 Jun 2016, 07:00 PM

Hi,

I have some custom sorting for RadTreeView (ASC and DESC)...but I need the indicating arrows to go with them in my TextBlock above that triggers the sorting...Is that possible ? Any help is appreciated.

Barry

 

<TextBlock Text="{x:Static properties:Resources.GroupHeader}" MouseUp="TextBlock_MouseUp" TextAlignment="Center" Style="{StaticResource HeaderTemplate}" HorizontalAlignment="Stretch"/>

 

        //GROUP CUSTOM SEARCH
        private void TextBlock_MouseUp(object sender, MouseButtonEventArgs e)
        {
            isoProvider.LoadFromStorage(groupTreeViewIsolatedStorage); //GET

            IEnumerable<GroupVM> groups = GroupTree.ItemsSource as IEnumerable<GroupVM>;

            if (GroupTreeViewOrdering.Content.Equals(ConstantsUnit.Key_SortAscending))
            {
                IEnumerable<GroupVM> test = groups.OrderByDescending(p => p.Name);
                GroupTree.ItemsSource = null;
                while (GroupTree.ItemsSource == null) {
                    GroupTree.ItemsSource = test;
                }

                //GroupTree.ItemsSource = groups.OrderByDescending(p => p.Name);
                GroupTreeViewOrdering.Content = ConstantsUnit.Key_SortDescending;
            }
            else if (GroupTreeViewOrdering.Content.Equals(ConstantsUnit.Key_SortDescending))
            {
                IEnumerable<GroupVM> test = groups.OrderBy(p => p.Name);
                GroupTree.ItemsSource = null;
                while (GroupTree.ItemsSource == null) {
                    GroupTree.ItemsSource = test;
                }

                //GroupTree.ItemsSource = groups.OrderBy(p => p.Name);
                GroupTreeViewOrdering.Content = ConstantsUnit.Key_SortAscending;
            }

            isoProvider.SaveToStorage(groupTreeViewIsolatedStorage); //SET
        }

2 Answers, 1 is accepted

Sort by
0
Accepted
Dinko | Tech Support Engineer
Telerik team
answered on 10 Jun 2016, 10:33 AM
Hi Barry,

If we have correctly understood your question you are trying to place sorting arrow next to the TextBlock when you are using RadTreeView control in the scenario describe in Implement Search, and Sort. If this is the case the RadTreeView doesn't support such functionality our of the box. Basically, you can use ToggleButton and place it next to the TextBlock and modified its appearance depending on the sorting (ACS or DESC). 

If we are in the wrong direction you can send us more information about the approach that you are trying to achieve in your application and sample project which could help us to better understand it.

Regards,
Dinko
Telerik
Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
0
Barry
Top achievements
Rank 1
answered on 10 Jun 2016, 01:50 PM
yeah, I knew it was along-shot. The real solution it seems is to drop the textblock/RadTreeView and use RadTreeListView for "one stop shopping" for it all. Thanks for your reply !
Tags
TreeView
Asked by
Barry
Top achievements
Rank 1
Answers by
Dinko | Tech Support Engineer
Telerik team
Barry
Top achievements
Rank 1
Share this question
or