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

Unable to cast object of type 'Telerik.Web.UI.RadGrid' to type 'Telerik.Web.UI.GridTableView'.

10 Answers 992 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Tom
Top achievements
Rank 1
Tom asked on 02 Jul 2008, 07:32 PM
Before upgrading to ASP.NET AJAX  from ASP.NET the rad grid grouping worked. Since upgrading however, as soon as a drag and drop grouping is preformed we are greeted with this error:

Unable to cast object of type 'Telerik.Web.UI.RadGrid' to type 'Telerik.Web.UI.GridTableView'.

I created a test page where I bound test data to a newly add rad grid and enabled grouping and it still blows up. 

I tried looking through the examples, but they either leave much to be desired or I followed them correctly and something is still not quiet right. Any ideas?

10 Answers, 1 is accepted

Sort by
0
Vlad
Telerik team
answered on 03 Jul 2008, 08:13 AM
Hi Tom,

Can post this test page or send us via support ticket?

Greetings,
Vlad
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Dave
Top achievements
Rank 1
answered on 27 Jul 2008, 06:31 PM
I am working with the trial verson of 2008 and am having the same problem.  Everything works except allowing the user to group.  Dragging a column to the group header box ALWAYS causes this error.  I have tried binding to a data source object, advanced data binding to a dataset I create and just manually adding rows.  I have also tried client-side and server-side grouping.

Nothing works.  I am trying to convince my client to purchase this package, as there are a lot of other controls that they would benefit from.  But the page on which this grid sits is a pretty crucial one for their application, so this absolutely has to work for them to spend the money.  And for the life of me, I can't get even your demos to work without this problem.

So the question: is this fixed in the new release?  Or is there something else I am not understanding? 

-Dave Ferreira
0
Vlad
Telerik team
answered on 28 Jul 2008, 05:33 AM
Hello Dave,

Can you reproduce the same in our online examples? Can you send us an example where we can reproduce this?

Sincerely yours,
Vlad
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Tom
Top achievements
Rank 1
answered on 28 Jul 2008, 12:50 PM
Hi Dave, 

    I'll give you my answer, though I'm not sure how much this will help you. My problem was because of the updates, one of my co-workers updated to lastest version from another and Telerik changed their namespaces. They (my co workers) corrected the code as descirbed in the telerik docs for upgrading but what was not mentioned in teleriks documentation was the web config. I didn't know what was old telerik or new telerik, so I rolled back the version of the web config and rebuilt it (everything but telerik). I then created a new project with the telerik controls, took the web config from that and added the telerik changes/additions to my newly rebuilt web config.  Presto change-o it all magically worked again.

Hope this helps, good luck!

-Tom
0
Dave
Top achievements
Rank 1
answered on 28 Jul 2008, 01:50 PM
Thanks, Tom and Vlad.  Found my problem although this is not specifically documented anywhere that I can tell.

The issue boiled down to this: if I tried to run either the demo or my code in VS 2005, then I had no problems.  If I tried to run either in VS2008, then I had the issue above.  The reason was because VS2008 (and compiling against framework version 3.5) looks for the HTTP handler for Telerik resources in the SYSTEM.WEB section and not in the old section.  When I added the control to the page from the toolbox, everything else seems to have been added except this (in other words, the reference was properly added to the project, because as far as I can tell that and the HTTP handler line in the old section were the only things added).

So once I added the handler statement to the right section for my project, all the problems went away.  Curious, though, that IE did not churn up an error when loading the page about scripts being missing, etc.  And even without that statement, skinning was working as expected. 

Thanks for your help.

-Dave Ferreira
0
Vance Smith
Top achievements
Rank 1
answered on 27 Jan 2009, 03:02 PM
I am having the same problem. What is the handler that needs to be added to System.Web. Can someone give me an example?

Thanks,

Vance
0
Dave
Top achievements
Rank 1
answered on 27 Jan 2009, 03:30 PM
Morning, Vance...

Here is what I had to add to get this to work.  I also added the spell check line, too.  Note that if you use the spell check module, you will need to change the version number below to match your assembly.

-Dave Ferreira

        <!--  HTTPHANDLERS --> 
        <httpHandlers> 
            <add path="Telerik.Web.UI.WebResource.axd" verb="*" type="Telerik.Web.UI.WebResource, Telerik.Web.UI" validate="false" /> 
            <add path="Telerik.Web.UI.SpellCheckHandler.axd" verb="*" type="Telerik.Web.UI.SpellCheckHandler, Telerik.Web.UI, Version=2008.1.515.20, Culture=neutral, PublicKeyToken=121fae78165ba3d4" validate="false" /> 
        </httpHandlers> 
 
0
Mark
Top achievements
Rank 1
answered on 18 Apr 2010, 01:29 PM
That helped me.  Thanks.
0
Mark
Top achievements
Rank 1
answered on 18 Apr 2010, 02:00 PM
Hmm.  The problem is back again.  It seems to come and go.  Shutting down Visual Developer Express 2008 and starting up again helps.
0
Thenmozhi
Top achievements
Rank 1
answered on 28 Jan 2011, 12:31 PM
Hi,

I have also faced the same issue while i migrate my project from 2005 to 2008.

I found this thread it solved my issue.

We have to remove the  <xhtmlConformance mode="Legacy"/> tag from webconfig.

Need more detail read below one

http://www.telerik.com/community/forums/aspnet-ajax/grid/255649-unable-to-cast-object-of-type-telerik-web-ui-radgrid-to-type-telerik-web-ui-gridtableview.aspx

Thanks
Thenmozhi.R
Julia Furman
Top achievements
Rank 2
commented on 13 Jun 2023, 07:37 PM

This solution helped me, thank you: 


We have to remove the  <xhtmlConformance mode="Legacy"/> tag from webconfig.

Tags
Grid
Asked by
Tom
Top achievements
Rank 1
Answers by
Vlad
Telerik team
Dave
Top achievements
Rank 1
Tom
Top achievements
Rank 1
Vance Smith
Top achievements
Rank 1
Mark
Top achievements
Rank 1
Thenmozhi
Top achievements
Rank 1
Share this question
or