You can enable sorting for all columns of a grid using the Sortable method for both GridClient and GridServer objects:
razor page
var client = new GridClient<Order>(q => orderService.GetOrdersGridRows(columns, q), query, false, "ordersGrid", Columns, locale)
.Sortable()
service method
var server = new GridServer<Order>(repository.GetAll(), Request.Query, true, "ordersGrid", columns, 10)
.Sortable()
In this case you can select sorting pressing the column name on just one column at a time.
Sorting at grid level has precendence over sorting defined at column level.
You can also configure extended sorting using the ExtSortable method for both GridClient and GridServer objects:
razor page
var client = new GridClient<Order>(q => orderService.GetOrdersGridRows(columns, q), query, false, "ordersGrid", Columns, locale)
.ExtSortable()
service method
var server = new GridServer<Order>(repository.GetAll(), Request.Query, true, "ordersGrid", columns, 10)
.ExtSortable()
In this case you can drag the column title and drop it on the sorting area. You can add multiple columns at the same time and select if sorting is ascending or descending column by column.
This is an example of a table of items using extended sorting:
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。