RadTreeView sort arrows ?

3 posts, 1 answers
  1. Barry
    Barry avatar
    29 posts
    Member since:
    May 2016

    Posted 07 Jun Link to this post

    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. Answer
    Dinko
    Admin
    Dinko avatar
    201 posts

    Posted 10 Jun Link to this post

    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, Filter 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.
  3. UI for WPF is Visual Studio 2017 Ready
  4. Barry
    Barry avatar
    29 posts
    Member since:
    May 2016

    Posted 10 Jun in reply to Dinko Link to this post

    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 !
Back to Top