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 c开发者_JS百科olumn work.
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
An Extensive Examination of the DataGrid Web Control: Part 4, Part 2
They are both part of a series of articles dealing with the 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#. 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
Let me know if that solves your problem.
精彩评论