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.
If someone could explain this, that would be great
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
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.