以编程方式设置数据源时对listview列进行排序 [英] Sorting the listview column when datasource set programmatically
问题描述
我的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列进行排序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!