منم همین مشکل رو دارم، :
<asp:GridView ID="GridViewSearchResult" runat="server" AllowSorting="True" >
<Columns>
<asp:TemplateField HeaderText="عنوان" SortExpression="Title">
<ItemTemplate>
<asp:Label ID="LabelTitle" runat="server" Text='<%# Bind("Title") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="موضوع" SortExpression="Subject" >
<ItemTemplate>
<asp:Label ID="LabelSubject" runat="server" Text='<%# Bind("Subject") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
در Codebehind هم نوشتم :
GridViewSearchResult.DataSource = Information.GetInfo(_title, _subject);
GridViewSearchResult.DataBind();
متد GetInfo در کلاس Information اطلاعات رو از Database می یاره.
با اینکه SortExpression رو هم برای ستونهام ست کردم بازم نمی شه!
چه جوری باید تابع Sort رو به صورت دستی پیاده کنم (اصلا این کار درسته؟)