PivotGrid Custom Column Sorting (Ordering)

4 posts, 0 answers
  1. MikeB
    MikeB avatar
    42 posts
    Member since:
    May 2008

    Posted 20 Jul 2015 Link to this post

    Hello,

    We have a need to create a custom sort order for columns in a pivot grid.  (It's more like creating a Column Order rather than a Sort.)  For example, the columns are Size and the (Header) values are "S", "M", "L", "XL", "XXL" and the columns need to be displayed in this order.  The Row values would be the quantity ​for each size.  And to add a twist, the "Size" values are dependent on the product.  For example, a different product would have Size values of "S/M", "M/L", "L/XL".  So this functionality would need to be dynamic. 

    Is this possible?

     

    Thanks,

    Mike

  2. Dimitar
    Admin
    Dimitar avatar
    1411 posts

    Posted 21 Jul 2015 Link to this post

    Hello Michael,

    Thank you for writing.

    To achieve the desired functionality, you should create a custom GroupComaprer. I have attached a small sample that shows how this can be achieved with month names. I think that you should be able to adopt this approach easily.

    I hope this helps. 

    Regards,
    Dimitar
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  3. UI for WinForms is Visual Studio 2017 Ready
  4. MikeB
    MikeB avatar
    42 posts
    Member since:
    May 2008

    Posted 29 Jul 2015 in reply to Dimitar Link to this post

    Thanks for the response Dimitar.  The sample works well with a single product.  But the customer can order different product in one order (one pivot grid).  Each product has it's own set of sizes.  When only one product is displayed the sort order is correct.  If more than one product is displayed in the grid, the columns are not sorted correctly.  Basically what we need is the product to "group" the product (which is the Rows), each with it's own sort order.  It seems that I have to inject the product in to the GroupComparer (when it is performing the sort.)  If you need more information I can create a spread sheet as an example of how it should look.

     

    Thanks,

    Mike

  5. Dimitar
    Admin
    Dimitar avatar
    1411 posts

    Posted 30 Jul 2015 Link to this post

    Hi Mike,

    Thank you for writing back. 

    It would be great if you could send us the spreadsheet. Could you please send us a snapshot of the pivot grid as well? This way we will have better understanding of your precise case.

    I am looking forward to your reply.

    Regards,
    Dimitar
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Back to Top