RadGridView WPF - How to sort by Group?

4 posts, 0 answers
  1. Keith
    Keith avatar
    3 posts
    Member since:
    Aug 2019

    Posted 15 Aug Link to this post

    Saw instructions on how to use tags GroupByExpression, SelectFields, GroupByFields to sort groups by a sequence number.  However, these tags are not available to me to use.

     

    So, I would like to use standard RadGridView properties and techniques to create 3 groups that will be sorted by a sequence number...

     

    3 Columns: Process, Date, Version

    3 Groups ordered top to bottom: Group1, Group2, Group3.

    When I click on the column name "Process" for example, currently the groups move up or down.

    I want to keep the groups in the same visual order Group1, Group2, Group3 but only sort each column within the group.

    Any ideas?

  2. Drago
    Admin
    Drago avatar
    9 posts

    Posted 16 Aug Link to this post

    Hello Keith,

    We have tried to reproduce the behavior you described, but we were not able to as usualy groups should not sort when you do a column sorting.

    We have used the GroupDescriptors collection to create a sample project based on your scenario and I hope we have captured what you are trying to do correctly.

    Can you please test and see if it works?
    If you are still having issues feel to modify the example or send us the code you are using so we can test it on our side.

    I hope that helps.

    Regards,

    Drago

    Progress Telerik

    Get quickly and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
  3. Keith
    Keith avatar
    3 posts
    Member since:
    Aug 2019

    Posted 16 Aug in reply to Drago Link to this post

    Thank you for your quick reply!

    First of all, does your example code compile?  I wanted to view how the WPF form works.

    For example, there is no constructor for InitializeComponent().

    Also, I am getting a lot of configuration errors:

    The tag 'RadGridView' does not exist in XML namespace 'http://schemas....' etc

    I copied all of the teleric dll's from my other project into this sample

    project directory and added them under Resources, but many still have a yellow triangle next to the name under Resources.

    Please advise if this code was not compiled.

            

  4. Keith
    Keith avatar
    3 posts
    Member since:
    Aug 2019

    Posted 19 Aug in reply to Drago Link to this post

    Good news!

    Just looking at your solution:

     

                <telerik:RadGridView.GroupDescriptors>
                   <telerik:GroupDescriptor Member="ID"
                                 SortDirection="Ascending" />
                </telerik:RadGridView.GroupDescriptors> 

     

    At first, the Groups didn't sort alphabetically, then I realized they were sorting by enum value of ID, so I rearranged the order of the Member IDs, then the groups stayed in a fixed position and the rows within the groups sorted when the columns were clicked.

    Thanks again for your help!

Back to Top