private void LoadDataToListView() { this.Loading = false; lvStudQuizData.Items.Clear(); ListViewItem lvi = null; _lviList.Clear(); foreach (DAO.UDT_StudQuizDataDef sqd in _StudQuizDataList) { lvi = new ListViewItem(); lvi.Tag = sqd; DAO.UDT_QuizDef qd = _UDTTransfer.GetQuizDataByID(sqd.QuizID.ToString()); lvi.Text = qd.QuizName; if (sqd.ImplementationDate.HasValue) { lvi.SubItems.Add(sqd.ImplementationDate.Value.ToShortDateString()); } else { lvi.SubItems.Add(""); } if (sqd.AnalysisDate.HasValue) { lvi.SubItems.Add(sqd.AnalysisDate.Value.ToShortDateString()); } else { lvi.SubItems.Add(""); } //lvStudQuizData.Items.Add(lvi); _lviList.Add(lvi); } // sort by ImplementationDate descending _lviList = (from data in _lviList orderby data.SubItems[colImplementationDate.Index].Text descending select data).ToList(); lvStudQuizData.Items.AddRange(_lviList.ToArray()); }