我使用LinqQ作为以下代码,但它没有做正确的排序

问题描述 投票:0回答:1

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

xamarin.ios
1个回答
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();

© www.soinside.com 2019 - 2024. All rights reserved.