I'm using an EntityDataSource together with a RadGrid. I have issues with combining an EntityDataSource "OrderBy" together with a "Select Top" statement.
<asp:EntityDataSource runat="server"
ID="EntityDataSourceAlarm"
ConnectionString="name=AlarmEntities"
DefaultContainerName="AlarmEntities"
EnableFlattening="False"
EntitySetName="Alarms"
OrderBy="it.Status ASC, it.TS DESC"
Select="top(10) it.[OID], it.[TS], it.[Status]">
</asp:EntityDataSource>
I want the order by clause to be applied before the select clause. It all works when leaving out the "top(10)
" part of the select clause. It should first sort by [Status] and and then [TS]. Then using top in the select statement, it seems like it discards the order by clause.
I'm using .Net 4.5 and EntityFramework 5.