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

Sort TreeListView fail with 2 o more levels of children.

1 Answer 164 Views
TreeListView
This is a migrated thread and some comments may be shown as answers.
Omar
Top achievements
Rank 1
Omar asked on 19 Dec 2018, 07:08 PM

Hi,I'm sorting a TreeListView clicking the header. See the structure below. All the top rows are sorted fine (Ascending and Descending), A5 row have 1 child level and is sorted good too. But A1 that have more than 1 level of children doesn't work. If I keep A1 with 1 level of children (just F1 and A2) the sort works. So TreeListView support sort with more that 1 horizontal level of children ?

A1 - 0
          F1- 1
          A2 - 2

                    F2 - 3 

                     A3 - 4

                               A4 - 5
                               F3- 6
A5 - 7
           F4-8
           F5-9
F6-10
F7-11

This is my xaml:

 

<telerik:RadTreeListView Grid.Row="2" x:Name="DeckDataGrid"
                               EnableLostFocusSelectedState="False"
                               CanUserSortColumns="True"
                               SelectionMode="Single"
                               cal:Message.Attach="[Event Sorting] = [Action SortingHandler($source, $eventArgs)]"
                               ItemsSource="{Binding Source={StaticResource EngineeringDeckMarksView}}"
                               TreeLinesVisibility="Hidden"
                               SelectedItem="{Binding SelectedDeckMark, Mode=TwoWay}"
                               HierarchyColumnIndex="1">
        <telerik:RadTreeListView.SortDescriptors >
          <telerik:SortDescriptor Member="MarkNumber" />
        </telerik:RadTreeListView.SortDescriptors>
        <telerik:RadTreeListView.ChildTableDefinitions>
          <telerik:TreeListViewTableDefinition ItemsSource="{Binding ChildrenDeckMarks}" />
        </telerik:RadTreeListView.ChildTableDefinitions>
        <telerik:RadTreeListView.Columns>
          <telerik:GridViewDataColumn MinWidth="32" IsSortable="True" SortMemberPath="IsSelected" EditTriggers="None">
            <telerik:GridViewDataColumn.CellTemplate>
              <DataTemplate DataType="deck:IBaseDeckMarkViewModel">
                <CheckBox Margin="10 0 0 0"
                          CommandParameter="{Binding}"
                          IsChecked="{Binding IsSelected, Mode=TwoWay}" />
              </DataTemplate>
            </telerik:GridViewDataColumn.CellTemplate>
          </telerik:GridViewDataColumn>
          <telerik:GridViewDataColumn HeaderCellStyle="{StaticResource StyleMarkHeader}" CellStyle="{StaticResource StyleMark}" Header="Mark" SortingState="Ascending" DataMemberBinding="{Binding DeckIndex}"  MinWidth="100" Width="120" IsReadOnly="True" />
          <telerik:GridViewDataColumn Header="Bundle" SortingState="Descending" DataMemberBinding="{Binding Bundle, TargetNullValue='--', FallbackValue='--', StringFormat='{}{0}'}" MinWidth="100" Width="100" IsReadOnly="True" />
          <telerik:GridViewDataColumn Header="Qty" SortingState="Ascending" DataMemberBinding="{Binding Quantity, TargetNullValue='--', FallbackValue='--' }" MinWidth="71" Width="71" IsReadOnly="True" />
          <telerik:GridViewDataColumn Header="Avail&#x0a;Qty" SortingState="Ascending" DataMemberBinding="{Binding AvailableQuantity, TargetNullValue='--', FallbackValue='--', StringFormat='{}{0}' }" MinWidth="80" Width="100" IsReadOnly="True" />
          <telerik:GridViewDataColumn Header="Length" SortingState="Ascending" DataMemberBinding="{Binding Length, TargetNullValue='--', FallbackValue='--', StringFormat='{}{0}', Converter={StaticResource LengthDisplayConverter}, ConverterParameter=FractionalFeet8th}" MinWidth="90" Width="90" IsReadOnly="True" />
          <telerik:GridViewDataColumn Header="Designation" SortingState="Descending" DataMemberBinding="{Binding Designation, TargetNullValue='--', FallbackValue='--', StringFormat='{}{0}' }" MinWidth="140" Width="150" IsReadOnly="True" />
          <telerik:GridViewDataColumn Header="Gage" SortingState="Descending" DataMemberBinding="{Binding Gage, TargetNullValue='--', FallbackValue='--', StringFormat='{}{0}' }" MinWidth="70" Width="70" IsReadOnly="True" />
          <telerik:GridViewDataColumn Header="Galv" SortingState="Ascending" SortMemberPath="GalvanizationThickness" DataMemberBinding="{Binding Galvanization, TargetNullValue='--', FallbackValue='--', StringFormat='{}{0}'}" MinWidth="70" Width="70" IsReadOnly="True" />
          <telerik:GridViewDataColumn Header="Top&#x0a;Finish" SortingState="Ascending" DataMemberBinding="{Binding TopFinish, TargetNullValue='--', FallbackValue='--', StringFormat='{}{0}' }" MinWidth="90" Width="90" IsReadOnly="True" />
          <telerik:GridViewDataColumn Header="Bot&#x0a;Finish" SortingState="Ascending" DataMemberBinding="{Binding BottomFinish, TargetNullValue='--', FallbackValue='--', StringFormat='{}{0}' }" MinWidth="90" Width="90" IsReadOnly="True" />
          <telerik:GridViewDataColumn Header="Emboss" SortingState="Ascending" DataMemberBinding="{Binding Emboss, TargetNullValue='--', FallbackValue='--', StringFormat='{}{0}'}" MinWidth="110" Width="110" IsReadOnly="True" />
          <telerik:GridViewDataColumn Header="Acoustic" SortingState="Ascending" DataMemberBinding="{Binding Acoustic, TargetNullValue='--', FallbackValue='--', StringFormat='{}{0}' }" MinWidth="110" Width="110" IsReadOnly="True" />
          <telerik:GridViewDataColumn Header="Perf" SortingState="Ascending" DataMemberBinding="{Binding Perforation, TargetNullValue='--', FallbackValue='--', StringFormat='{}{0}' }" MinWidth="80" Width="120" IsReadOnly="True" />
          <telerik:GridViewDataColumn Header="Yield" SortingState="Ascending" DataMemberBinding="{Binding Yield, TargetNullValue='--', FallbackValue='--', StringFormat='{}{0}' }" MinWidth="80" Width="120" IsReadOnly="True" />
          <telerik:GridViewDataColumn Header="Wt Ea" SortingState="Ascending" DataMemberBinding="{Binding WeightEach, TargetNullValue='--', FallbackValue='--', StringFormat='{}{0}', Converter={StaticResource RoundAwayFromZeroConverter}, ConverterParameter=2}" MinWidth="80" Width="120" IsReadOnly="True" />
          <telerik:GridViewDataColumn Header="Bundle&#x0a;Desc" SortingState="Ascending" DataMemberBinding="{Binding BundleDescription, TargetNullValue='--', FallbackValue='--', StringFormat='{}{0}' }" Width="110" MinWidth="110" IsReadOnly="True" />
          <telerik:GridViewDataColumn Header="Width" SortingState="Ascending" DataMemberBinding="{Binding Width, TargetNullValue='--', FallbackValue='--', StringFormat='{}{0}' }" MinWidth="105" Width="*" IsReadOnly="True" />
        </telerik:RadTreeListView.Columns>
      </telerik:RadTreeListView>

 

1 Answer, 1 is accepted

Sort by
0
Accepted
Stefan
Telerik team
answered on 24 Dec 2018, 01:10 PM
Hello Omar,
 
I tested the behavior of the control we the latest assemblies version, as well with a couple of older ones. With all of them RadTreeListView sorted its items irrelevant to whether the child items on first level have child items or not. Attached to my reply you can find a sample application as a demonstration. Can you please check it out? Would it be possible for you to modify it so that the sorting malfunction is reproduced, open a new support thread and attached the modified sample in it? We would gladly assist you further.
 
Thank you in advance for your cooperation.


Regards,
Stefan
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
TreeListView
Asked by
Omar
Top achievements
Rank 1
Answers by
Stefan
Telerik team
Share this question
or