I'm using WebGrid to display data on client side, canSort: true
is set.
The view code is:
@model UI.Models.TestModel
@if (Model.listTestModel != null)
{
var grid = new WebGrid(Model.listTestModel,
null,
defaultSort: "ColumnA",
rowsPerPage: 25,
canPage: true,
canSort: true
);
@grid.GetHtml(
mode: WebGridPagerModes.All,
columns: grid.Columns
(
grid.Column(columnName: "ColumnA", header: "ColumnA"),
grid.Column(columnName: "ColumnB", header: "ColumnB")
)
)
}
I'm able to sort data by clicking column headers.
Problem:
How can someone asynchronously sort the WebGrid using Ajax?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…