以编程方式设置数据源时对listview列进行排序

编程入门 行业动态 更新时间:2024-10-23 21:26:14
本文介绍了以编程方式设置数据源时对listview列进行排序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我的Web应用程序中有一个以编程方式绑定到数据的listview控件. 由于它是通过程序绑定的,因此我没有内置的对列排序的支持. 我正在使用linkbutton作为列标题名称,并且如果用户单击它却想找到一种实现它的方法,则希望对asc/desc进行排序. 请让我知道实现此功能的方法. 谢谢, Vasanth

Hi, I have a listview control in my webapplication that is programmatically bound to data. Since it is programmatically binded, i don''t have built in support for sorting columns. I am using linkbutton as column header name and want to sort asc/desc if user clicks on it but not finding a way to achieve it. Please let me know the way to achieve this functionality. Thanks, Vasanth

推荐答案

为什么您认为程序绑定的列表视图不支持排序? 你能行的.像这样的东西: Why do you think that sorting is not supported for programmatically binded listview? You can do it. Something like: ListView1.Sort("Name", SortDirection.Ascending);

在链接"按钮上单击时,使用排序表达式".在这里查看详细信息: ListView.Sort方法 [ ^ ]

On Link button clicks, use the Sorting Expression. Look here for details: ListView.Sort Method [^]

更多推荐

以编程方式设置数据源时对listview列进行排序

本文发布于:2023-10-30 19:11:39,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1543739.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:数据源   方式   listview

发布评论

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

>www.elefans.com

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