我使用MVC jqGrid创建网格,这是我填充网格的代码
var jsonData = new
{
total = formTemplatePage.TotalEntriesCount / (pageSize + childrenCount) + 1,
page = gridSettings.PageIndex,
rows = (
gridData.Select(c => new
{
id = c.Item.Id,
cell = new[]
{
c.Number,
c.Item.Name,
c.Item.Id.ToString(),
c.Item.Active.ToString(),
c.Level,
c.ParentId,
c.IsLeaf,
c.Expanded,
c.UnKnown,
}
})).ToList()
};
但我怎样才能获得c.Item.Active == true
?
答案 0 :(得分:1)
您只需将行选择更改为
即可gridData.Where(c => c.Item.Active).Select([...]);