RadGrid Sort Error InvalidCastException

3 posts, 0 answers
  1. bhenke
    bhenke avatar
    8 posts
    Member since:
    Sep 2006

    Posted 02 Dec 2014 Link to this post


    Yesterday I upgraded from RadControls for .NET Q1 2010 to the UI for ASP.NET AJAX Q3 2014.  I have three solutions which utilize the RadGrid extensively.  In my development environment (VS 2010) all of my projects work great.  However, when they are deployed to a Windows 2003 IIS 6 server, I am receiving the following errors when I try to sort any RadGrid in my project:

    System.InvalidCastException: Unable to cast object of type 'Telerik.Web.UI.RadGrid' to type 'Telerik.Web.UI.GridTableView'. at Telerik.Web.UI.RadGrid.RaisePostBackEvent(String eventArgument) at System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) at System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

    Other basic functions appear to be working properly including rendering of the grid as well as pagination.

    Two of the solutions share an application pool on my web server so I though perhaps that might be an issue (even though I know they have their own memory spaces) so I set up a brand new Windows Server 2003 machine patched fully as of this morning.  I am still having the error there.

    I have verified that I am sending out the correct version of the DLL and verified that my web.config file has the correct entries per the online demos folder installed on my development machine.

    Can you please suggest a solution?

    Thank you!

  2. bhenke
    bhenke avatar
    8 posts
    Member since:
    Sep 2006

    Posted 02 Dec 2014 in reply to bhenke Link to this post


    After some more research and experiments the problem has turned out to be the xhtmlConformance element.  Although not explicitly defined in my web.config, by adding the element with the "strict" or "transitional" value the sorting works.

    I'm not 100% sure why I must explicitly declare the xhtmlConformance as it was my understanding you can simply run without it (e.g. not listed in your web.config).

    Can this be defined by default in the machine.config maybe?
  3. Viktor Tachev
    Viktor Tachev avatar
    1784 posts

    Posted 05 Dec 2014 Link to this post


    Based on the provided information it would be hard to pinpoint what is causing the errors. However, there were reports for similar errors. Check out the following thread that suggests a possible solution:


    Viktor Tachev

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

Back to Top