开发者

Genexus: Sort a Top10 list (grid) using a variable

开发者 https://www.devze.com 2023-04-09 20:55 出处:网络
I have the following issue: I\'m generating a Top10 list of i开发者_开发百科tems, based on how many times each item has been sold. I can calculate that number and store it in a variable correctly, but

I have the following issue: I'm generating a Top10 list of i开发者_开发百科tems, based on how many times each item has been sold. I can calculate that number and store it in a variable correctly, but when I try to sort the grid by that variable programatically, Genexus won't let me (ofcourse I can click on that row and it'll get sorted correctly, but that's not what I want).

As far as I've read, grids can't be sorted using variables for some reason, is there a workaround for this?


You should use a Data Provider to load a SDT with the Top10 list of items, sorted by solded items. Then show the output SDT in a grid.


You should try to find a way to load them in the proper order. If that is not posible, create an SDT Collection with the items and use the method sort. After that, change the grid to a non-base table grid and use the load event to load the content of the collection.

0

精彩评论

暂无评论...
验证码 换一张
取 消