Hello,
While working on a Grid we integrated in one of our pages, I noticed how the sorting was not working properly. When trying to sort, the column gets marked as sorted (either asc or desc), but the actual items in the grid do not get sorted at all, they stay in the exact same order as they were before.
Trying to figure out what the problem was, I seem to have gotten the problem down to its core: the EntityDataSource bound via the RadGrid_NeedDataSource event handler.
Code:
Code Behind:
Is this a known issue? Is there anything I can do to resolve this problem?
Any help would be more than welcome!
Thanks,
Glenn
While working on a Grid we integrated in one of our pages, I noticed how the sorting was not working properly. When trying to sort, the column gets marked as sorted (either asc or desc), but the actual items in the grid do not get sorted at all, they stay in the exact same order as they were before.
Trying to figure out what the problem was, I seem to have gotten the problem down to its core: the EntityDataSource bound via the RadGrid_NeedDataSource event handler.
Code:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="test.aspx.cs" Inherits="test" MasterPageFile="~/Site.master" Theme="EventDrive" %><%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %><asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent"><telerik:RadScriptManager ID="RadScriptManager" runat="server" /><telerik:RadGrid ID="RadGrid1" OnNeedDataSource="RadGrid_NeedDataSource" runat="server" AllowPaging="True" AllowSorting="True"></telerik:RadGrid><asp:EntityDataSource ID="edsED" runat="server" ConnectionString="name=EventdriveEntities"DefaultContainerName="EventdriveEntities" EntitySetName="Person" AutoSort="true" /> </asp:Content>Code Behind:
using System;using System.Collections.Generic;using System.Linq;using System.Web;using System.Web.UI;using System.Web.UI.WebControls;using Telerik.Web.UI;public partial class test : System.Web.UI.Page{ protected void RadGrid_NeedDataSource(object sender, GridNeedDataSourceEventArgs e) { edsED.Where = "it.EventID = 2324"; //fetch EventID here. RadGrid1.DataSource = edsED; }}Is this a known issue? Is there anything I can do to resolve this problem?
Any help would be more than welcome!
Thanks,
Glenn