排序列表< DataRowView>一栏

编程入门 行业动态 更新时间:2024-10-27 09:45:07
本文介绍了排序列表< DataRowView>一栏的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

大家好

我有一个绑定到DataTable的BindingSource

然后我用所有的填充DataRowView(MyList)列表来自BindingSource的行。

现在我需要使用特定的列索引对MyList进行排序

如何做?

注意,我无法对BindingSource进行排序,因为MyList是另一个对象的属性

解决方案

您是否尝试过这样的代码? : 'sorted_list = MyList.OrderBy(r => r [columnIndexOrName])。ToList()'?

Hi all

I Have a BindingSource bound to DataTable

Then I fill a List of DataRowView (MyList) with all the rows coming from BindingSource.

Now I need to sort MyList with a specific Column index

How to do that ?

Note, I cannot sort BindingSource since MyList is a property of another object

解决方案

Did you try a code like this: ‘sorted_list = MyList.OrderBy( r => r[columnIndexOrName] ).ToList()’?

更多推荐

排序列表< DataRowView>一栏

本文发布于:2023-10-14 19:05:47,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1491939.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:列表   amp   lt   DataRowView   gt

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!