2009-06-22 31 views

回答

1

閱讀本排序的ASP.NET的GridView對象 MSDN ... :)

2

您是否使用了EntityDataSource?您是否啓用了GridView上的AllowSortingAllowPaging屬性?

<asp:GridView ID="GridView1" runat="server" 
     AllowPaging="True" AllowSorting="True" 
     AutoGenerateColumns="True" 
     DataSourceID="EntityDataSource1"> 
    </asp:GridView> 
    <asp:EntityDataSource ID="EntityDataSource1" runat="server" 
     ConnectionString="......" 
     EntitySetName="......." 
     Select=".........." OrderBy="......"> 
    </asp:EntityDataSource> 

馬克

+0

我不使用EntityDataSource爲什麼我需要它。我想使它成爲C#代碼。 – Penguen 2009-06-22 14:11:02