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
5 Answers, 1 is accepted
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
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
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
Hello, Wenbo,
I would like to note that this forum is related to the Telerik UI for WinForms suite. According to the provided information, it seems that you don't use RadPivotGrid from the WinForms suite. Feel free to post your question on the relevant forum according to the product that you use: https://www.telerik.com/forums
Thank you for your understanding.
Regards,
Nadya
Progress Telerik
Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.