简体   繁体   English

在数据网格中对模板列进行排序

[英]Sorting a template column in a datagrid

I have a datagrid and a template column which is bound. 我有一个数据网格和绑定的模板列。 I don't understand how to set the sortExpression to make sorting on that column work. 我不明白如何设置sortExpression以使对该列进行排序。

If someone could explain this, that would be great 如果有人可以解释这一点,那就太好了

Without posting some of your code it is difficult to figure out exactly what is not working. 如果不发布您的一些代码,很难准确地找出什么不起作用。 But, if you are looking for information in general about how to do sorting with the datagrid, then the following articles might be of help. 但是,如果您正在寻找有关如何对数据网格进行排序的一般信息,那么以下文章可能会有所帮助。

An Extensive Examination of the DataGrid Web Control: Part 4 DataGrid Web控件的广泛检查:第4部分

An Extensive Examination of the DataGrid Web Control: Part 4, Part 2 全面检查DataGrid Web控件:第4部分,第2部分

They are both part of a series of articles dealing with the DataGrid. 它们都是有关DataGrid的一系列文章的一部分。 I would recommend reading the entire series. 我建议阅读整个系列。

Note: The code is in VB.Net, but it shouldn't be hard converting it to C#. 注意:该代码位于VB.Net中,但将其转换为C#并不困难。 Anyway, it seems like you are more interested in how this works rather than specific code snippets. 无论如何,似乎您对它的工作方式更感兴趣,而不是特定的代码片段。

I have a full blog article on this one which you can view here GirdView Paging and Sorting 我对此有完整的博客文章,您可以在此处查看GirdView的分页和排序

Let me know if that solves your problem. 让我知道是否可以解决您的问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM