日期:2014-05-18 浏览次数:20423 次
DataView objView = new DataView(FileList); //FileList是结果集DataTable objView.Sort = "CreateTime DESC"; //CreateTime是结果集中的列 GridView1.DataSource = objView; GridView1.DataKeyNames = new string[] { "FileURL" }; GridView1.DataBind();
------解决方案--------------------
前台:
//设Grid的OnSorting="GridData_Sorting" <asp:TemplateField HeaderText="广告标题" SortExpression="Title"> <ItemTemplate> <%# Eval("Title")%> </ItemTemplate> </asp:TemplateField>