我在下面的代码中使用LINQ,但是排序不正确。
if (index == 0) {
if (Incomplete_issue_model.Count < 1) {
LblExistIssue.Hidden = false
} else {
tblCustomerIssueListView.Hidden = false
Incomplete_issue_model = Incomplete_issue_model.OrderBy(d =>d.Issue_Date).ToList()
tblCustomerIssueListView.Source = new CustomerIssueViewDataSource(Incomplete_issue_model, this)
tblCustomerIssueListView.ReloadData()
}
}
日期格式为dd-mm-yy hh:mm:ss AM
答案 0 :(得分:0)
issueDateTime = DateTime.ParseExact(issue_date,“ dd-MM-yyyy hh:mm:ss”,CultureInfo.InvariantCulture);
issue.issueDateTime = issueDateTime;
之后进行排序
Incomplete_issue_model = Incomplete_issue_model.OrderByDescending(d => d.issueDateTime).ToList();