c# - 如何在 C# 中的 ListView 上运行 Linq 查询?
问题描述
我想在 C# 中的 ListView 上运行 Linq 查询。
我的目标是检查所有年轻学生的名单,除了我的 ListView 的每组中最年长的学生
BindingList<StudentsList> MyStudents = new BindingList<StudentsList>();
private void Query()
{
var results = MyStudents.OrderByDescending(x => x.DateTime)
.GroupBy(x => x.DateTime)
.Select(x => x.First())
.ToList();}
public class StudentsList
{
public StudentsList()
public string Student { get; set; }
public string Location { get; set; }
public int Age { get; set; }
public DateTime DOB { get; set; }
public string Interest { get; set; }
public string School { get; set; }
}
解决方案
推荐阅读
- javascript - Javascript函数初始化
- java - Quarkus:列表中的重复条目
同一个实体对象 - sql - node.js SQL插入到数组
- firebase - Android Studio:Google Admob 插页式测试广告仅部分有效
- python - 创建拆分点为整数的列表列表
- python - 将 Python export_text 决策规则转换为 SAS IF THEN DO;结束代码
- sorting - sbcl 注意“无法堆栈分配”
- batch-file - 如何在以下代码中免除文件或文件夹删除
- java - LibGDX:在 Android 中渲染时质量很差
- php - 如何在 Wordpress 中按类别获取所有帖子