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

JavaScript Error with AutoGenerateColumns="False" and UseStaticHeaders="True"

6 Answers 111 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Zach Alsgaard
Top achievements
Rank 1
Zach Alsgaard asked on 27 Jun 2008, 09:21 PM

I’ve found that you get the following JavaScript error when you have AutoGenerateColumns set to false and UseStaticHeaders set to true for a RadGrid:

Sys.InvalidOperationException: A control is already associated with the element. 

I guess this is the result of telling the RadGrid to use static headers twice (in some form or another), but it was somewhat difficult to figure out what exactly was causing the JavaScript error (we found the answer by removing different attributes until we found the right one).

Here is the basic RadGrid definition (just for reference):

<telerik:RadGrid runat="server" AutoGenerateColumns="False">              
    <ClientSettings> 
        <Scrolling UseStaticHeaders="True" /> 
    </ClientSettings> 
    .  
    .  
    .  
</telerik:RadGrid> 

6 Answers, 1 is accepted

Sort by
0
Scott
Top achievements
Rank 1
answered on 27 Jun 2008, 09:33 PM
Zach,

I think your problem is probably somewhere else. We use AutoGenerateColumns="False" and UseStaticHeaders="True" on almost every single grid.

Scott
0
Zach Alsgaard
Top achievements
Rank 1
answered on 27 Jun 2008, 09:38 PM

Scott,

You’re right – I checked again and realized that the problem was actually the result of having the UseStaticHeaders attribute set in the Skin definition for our RadGrid (this might just be something you’re not supposed to do).

Thanks,
- Zach

0
Zach Alsgaard
Top achievements
Rank 1
answered on 27 Jun 2008, 10:11 PM
After my last post I tried testing this issue some more to try to narrow it down a bit, and now my RadGrid is showing the JavaScript error without the Skin definition (it shows the error now by just having the UseStaticHeaders attribute in the ClientSettings of the RadGrid)…  I’d really like to know what’s causing this because the JavaScript error is preventing other client-side events from firing (gotta love the infamous JavaScript failure domino effect).  I definitely think this warrants an investigation by the Telerik team to see if they can recreate this issue (both with and without a Skin definition).
0
Sebastian
Telerik team
answered on 30 Jun 2008, 07:50 AM
Hi Zach,

I tried to recreate the issue you depicted on the local version of this online demo as well as in several other tests but unfortunately to no avail. Can you please verify that you are using the latest version of RadGrid for ASP.NET AJAX (2008.1.619)? I will also appreciate if you paste the problematic grid definition along with the relevant code-behind logic in this forum post. Thus I will be able to advice you further.

Best regards,
Stephen
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Zach Alsgaard
Top achievements
Rank 1
answered on 09 Jul 2008, 08:35 PM
Hi Stephen,

Thank you very much for the quick response (and sorry for my slow response here).

We just upgraded our Telerik installation to 2008.1.619 last week and we are still seeing this issue.  One thing I have noticed and forgot to mention in my original post is that our grids work fine when they are put stand-alone on the page, but we see the JavaScript error when they are inside of a RadPageView.  The hierarchy is as follows:

RadGrid
   |_  User Control
           |_ RadPageView
                  |_ RadMultiPage
                         |_ User Control
                                |_ Page

The code worked without any JavaScript errors when inside the following hierarchy:

RadGrid
   |_  User Control
           |_ Page

I'm sorry I'm not able to send you our code at this time, but if it helps solve this issue I'd be happy to try recreating it in a separate solution.

Thanks,
- Zach
0
Paul
Telerik team
answered on 16 Jul 2008, 12:48 PM
Hello Zach,

Unfortunately, the provided information does not help us much in reproducing the error. I'm afraid we could not be of much help unless we reproduce the issue on our side. It will be best if you can open a support ticket and send us a simple running project (incl. your custom skin, CSS, images, DB backup if needed and so on) demonstrating the problem (and step-by-step instructions on doing so). In that way we can reproduce and pinpoint the problems you're facing on our side, understand the logic of your application and provide a solution.

Greetings,
Paul
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
Grid
Asked by
Zach Alsgaard
Top achievements
Rank 1
Answers by
Scott
Top achievements
Rank 1
Zach Alsgaard
Top achievements
Rank 1
Sebastian
Telerik team
Paul
Telerik team
Share this question
or