This is a migrated thread and some comments may be shown as answers.

InvalidCastException whilst grouping on the RadGrid

2 Answers 75 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Gordon
Top achievements
Rank 1
Gordon asked on 12 Feb 2009, 11:22 AM
I have a radgrid which works really well.  I've extended the functionality to use grouping, but whenever a column is dragged to the grouping area, or dragged from the grouping area back to the columns; an InvalidCastException occurs.

[InvalidCastException: Unable to cast object of type 'Telerik.Web.UI.RadGrid' to type 'Telerik.Web.UI.GridTableView'.] 
   Telerik.Web.UI.RadGrid.RaisePostBackEvent(String eventArgument) +1692 
   System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13 
   System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +175 
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1565 
 

I've checked my httphandlers section in the webconfig (as a previous thread suggests), but the relevant Telerik.Web.UI.WebResource.axd entry is already present.
<httpHandlers> 
      <remove verb="*" path="*.asmx" /> 
      <add verb="*" path="*.asmx" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" /> 
      <add verb="*" path="*_AppService.axd" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" /> 
      <add verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" validate="false" /> 
      <add path="Telerik.Web.UI.WebResource.axd" type="Telerik.Web.UI.WebResource" verb="*" validate="false" /> 
    </httpHandlers> 
    <httpModules> 
      <add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" /> 
    </httpModules> 


Any ideas?

2 Answers, 1 is accepted

Sort by
0
Yavor
Telerik team
answered on 16 Feb 2009, 01:21 PM
Hi Gordon,

Can you please also provide the declaration of the control, as well as the code-behind file, so that I can try and recreate the setup locally?

Best wishes,
Yavor
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Gordon
Top achievements
Rank 1
answered on 16 Feb 2009, 01:28 PM
I've sorted the problem.

It was down to a stray key in the web.config

<xhtmlConformance mode="Legacy"/> 

After finding the problem key, i googled it and found this helpful blog;
http://weblogs.asp.net/scottgu/archive/2006/12/10/gotcha-don-t-use-xhtmlconformance-mode-legacy-with-asp-net-ajax.aspx
Tags
Grid
Asked by
Gordon
Top achievements
Rank 1
Answers by
Yavor
Telerik team
Gordon
Top achievements
Rank 1
Share this question
or