【发布时间】:2009-06-22 09:02:20
【问题描述】:
我正在使用 ADO.NET Entity Framework 数据模型。我通过 ADO.NET Entity Framework 将数据从 SQL 发送到 GridView。
但是如果我使用 EF,我如何对 gridview'columns 进行排序
【问题讨论】:
标签: c# .net asp.net entity-framework
我正在使用 ADO.NET Entity Framework 数据模型。我通过 ADO.NET Entity Framework 将数据从 SQL 发送到 GridView。
但是如果我使用 EF,我如何对 gridview'columns 进行排序
【问题讨论】:
标签: c# .net asp.net entity-framework
您使用的是EntityDataSource 吗?您是否在 GridView 上启用了 AllowSorting 和 AllowPaging 属性?
<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>
马克
【讨论】:
阅读本文以对 ASP.NET GridView 对象进行排序 MSDN... :)
【讨论】: