GridView 用代码如何实现排序?
前台代码:
<asp:GridView ID= "GridView1 " runat= "server " AllowSorting= "True "
AutoGenerateColumns= "False " DataKeyNames= "NewsTitle " DataSourceID= "AccessDataSource1 "
Height= "105px " Width= "316px " PageSize= "3 " ShowHeader= "False " OnSelectedIndexChanged= "GridView1_SelectedIndexChanged ">
<Columns>
<asp:TemplateField HeaderText= "新闻内容 " SortExpression= "新闻内容的列名 " >
<ItemTemplate>
<a href= '.\宫内要闻\news_more.aspx?NewsID= <%# DataBinder.Eval(Container, "DataItem.NewsID ") %> '>
<%# DataBinder.Eval(Container, "DataItem.NewsTitle ")%>
</a>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField= "PudDate " HeaderText= "PudDate " SortExpression= "PudDate " />
&n