Gridview sorting with custom template fields
问题 I can't seem to figure out how to sort my gridview with both databound AND custom fields. The custom field look like this: <asp:Label ID="lblItems" runat="server" Text='<%# GetItems((int)DataBinder.Eval(Container.DataItem, "ObjectCategoryID"))%>' /> It calls for a function which shows how many item the given category has. The sorting for the databounded fields work perfec but not the customfields. Im also looking for a generic method which works for all my gridviews. Can someone help me in