【发布时间】:2016-03-11 16:15:49
【问题描述】:
我有这样的课:
public class CellModel
{
public uint scheduleTaskID { get; set; }
public string task { get; set; }
public string baselineDate { get; set; }
public string scheduledDate { get; set; }
public string actualDate { get; set; }
public string finishedDate { get; set; }
public string expectedStart { get; set; }
public string expectedFinish { get; set; }
public string plusMinus { get; set; }
public string completedBy { get; set; }
public bool selected { get; set; }
public bool isEditableRow { get; set; }
public uint sortOrder { get; set; }
public override string ToString()
{
return scheduleTaskID.ToString();
}
}
现在,我有 3 个带有这些 sortOrder (31, 30, 32) 的类项,我想做的是将这些类项按 sortOrder 或其 (30, 31, 32) 的顺序排列
我尝试了以下方法:
cells.OrderBy(c => c.sortOrder);
但它什么也没做,订单仍然存在 (31, 30, 32) 我做错了什么?
【问题讨论】:
标签: asp.net