I have a WebGrid sort that is not doing anything upon clicking the headers.
The WebGrid is contained within a Partial View that looks like this -
@model MyModel
var grid = new WebGrid(Model.MyList, defaultSort: "MyField", canSort: true, ajaxUpdateContainerId: "MyContainer", canPage: false);
<div id="MyContainer">
@grid.GetHtml(
columns: grid.Columns(
grid.Column("col1", "Col1", format: @<text>@item.field1</text>),
grid.Column("col2", "Col2", format: @<text>@item.field2</text>),
grid.Column("col3", "Col3", format: @<text>@item.field3</text>)
)
)
</div>
In the controller -
[HttpGet]
public ActionResult MyController()
{
MyModel m = new MyModel()
m = (MyModel)Session["MyModel"];
return PartialView("MyView", dr);
}
I was wondering if it has something to do with the fact that I am pulling the model from a Session variable? If not is there something else I may be doing wrong?
If nothing looks wrong, any information as to how WebGrid sort works to help me trouble shoot would be greatly appreciated.
Thanks!