我正在使用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
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();