Can someone share how to practically implement gridview sorting and handle that event if:
- The data is binded manually
- Gridview is built using template field that is pumped from code behind only (not from the markups)
I build my gridview solely from codebehind therefore I can’t use the default method or solution.
Thank you
This might be what you are looking for:
This is an example of the TemplateField:
By adding the SortExpression property the GridView header will become clickable. Make sure the sort expression attribute is the name of the field that you are binding through the sql query.
Hope this helps.