Asp.net mvc Jqgrid排序不工作

Asp.net mvc Jqgrid排序不工作,asp.net-mvc,linq,sorting,jqgrid,Asp.net Mvc,Linq,Sorting,Jqgrid,我用下面的代码创建了一个jqgrid,并且在没有排序的情况下成功地创建了jqgrid。所以我修改了代码,但它没有对数据进行排序,并显示以下错误 'firstName' could not be resolved in the current scope or context. Make sure that all referenced variables are in scope, that required schemas are loaded, and that namespaces are

我用下面的代码创建了一个jqgrid,并且在没有排序的情况下成功地创建了jqgrid。所以我修改了代码,但它没有对数据进行排序,并显示以下错误

'firstName' could not be resolved in the current scope or context. Make sure that all referenced variables are in scope, that required schemas are loaded, and that namespaces are referenced correctly. Near simple identifier, line 6, column 1.
控制器 雷克斯

您的colmodel中缺少一个属性

要进行排序,您需要添加索引,如下所示:

{ name: 'firstName', index: 'firstName', sortable: true, sorttype: "text", searchoptions: { sopt: ['eq', 'ne'] }, width: 180 }
雷克斯

您的colmodel中缺少一个属性

要进行排序,您需要添加索引,如下所示:

{ name: 'firstName', index: 'firstName', sortable: true, sorttype: "text", searchoptions: { sopt: ['eq', 'ne'] }, width: 180 }

var_Customers=db.Customers.OrderBy(“it.”+sidx+“”+sord).Skip(pageIndex*pageSize).Take(pageSize).ToArray()


您只需在order by keywork中更改“it.”

var\u Customers=db.Customers.OrderBy(“it.”+sidx+“”+sord).Skip(pageIndex*pageSize).Take(pageSize).ToArray()

你只要按钥匙工作的顺序改变“它”

{ name: 'firstName', index: 'firstName', sortable: true, sorttype: "text", searchoptions: { sopt: ['eq', 'ne'] }, width: 180 }