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

Error when trying to use static headers

7 Answers 103 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Mike Eaton
Top achievements
Rank 1
Mike Eaton asked on 12 Nov 2008, 12:37 PM
Hi,

I have a rad grid that I wanted to have static headers for, when I added the code

 

<ClientSettings>

 

<Scrolling AllowScroll="True" UseStaticHeaders="true"/>

 

</ClientSettings>

and ran my app again, I got the following error when the page that contained the grid loaded:

Microsoft JScript runtime error: Sys.InvalidOperationException: A control is already associated with the element.

I am using the the ajax 2008 qtr 2 version of the telrik controls.

Many thanks

7 Answers, 1 is accepted

Sort by
0
Vlad
Telerik team
answered on 12 Nov 2008, 01:26 PM
Hello Mike,

I have seen such errors only with our "Classic" RadGrid and RadAjax. Can you post a bit more info or example how to reproduce this?

All the best,
Vlad
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Mike Eaton
Top achievements
Rank 1
answered on 12 Nov 2008, 02:24 PM
Ok here is my grid .... it is bound using a datatable when you click on a button

<

telerik:RadGrid ID="DetailGrid" Width="980px" runat="server" AutoGenerateColumns="False" GridLines="None" OnItemDataBound="DetailGrid_ItemDataBound" AllowFilteringByColumn="True" OnDataBound="DetailGrid_DataBound">

 

 

<MasterTableView>

 

 

<RowIndicatorColumn>

 

 

<HeaderStyle Width="20px" />

 

 

</RowIndicatorColumn>

 

 

<ExpandCollapseColumn>

 

 

<HeaderStyle Width="20px" />

 

 

</ExpandCollapseColumn>

 

 

<NoRecordsTemplate>

 

 

<asp:Label ID="NoRecordsLabel" runat="server" Text ="There are no records to show"></asp:Label>

 

 

</NoRecordsTemplate>

 

 

<Columns>

 

 

<telerik:GridBoundColumn DataField="Name" HeaderText="Name" UniqueName="nameColumn" AllowFiltering="False">

 

 

</telerik:GridBoundColumn>

 

 

 

<telerik:GridBoundColumn HeaderText="Error" UniqueName="errorColumn" DataField="ErrorKey" AllowFiltering="False">

 

 

</telerik:GridBoundColumn>

 

 

<telerik:GridTemplateColumn UniqueName="AcceptColumn" AllowFiltering="False">

 

 

<HeaderTemplate>

 

 

<asp:Label ID="AcceptHeaderLabel" runat="server" Text="Accept"></asp:Label>

 

 

<asp:CheckBox ID="AcceptCheckBoxHeader" runat="server" onclick="CheckUncheckAll(this.checked, 'AcceptCheckBox')"/>

 

 

</HeaderTemplate>

 

 

<ItemTemplate>

 

 

<asp:CheckBox ID="AcceptCheckBox" runat="server" AutoPostBack="true" onclick="UncheckOpposite(this, true)"/>

 

 

</ItemTemplate>

 

 

</telerik:GridTemplateColumn>

 

 

<telerik:GridTemplateColumn UniqueName="RejectColumn" HeaderText="Reject" AllowFiltering="False">

 

 

<HeaderTemplate>

 

 

<asp:Label ID="RejectHeaderLabel" runat="server" Text = "Reject"></asp:Label>

 

 

<asp:CheckBox ID="RejectCheckBoxHeader" runat="server" onclick="CheckUncheckAll(this.checked, 'RejectCheckBox')" />

 

 

 

</HeaderTemplate>

 

 

<ItemTemplate>

 

 

<asp:CheckBox ID="RejectCheckBox" runat="server" AutoPostBack="true" onclick="UncheckOpposite(this, false)"/>

 

 

</ItemTemplate>

 

 

</telerik:GridTemplateColumn>

 

</Columns>

 

 

</MasterTableView>

 

 

<FilterMenu EnableTheming="True">

 

 

<CollapseAnimation Duration="200" Type="OutQuint" />

 

 

</FilterMenu>

 

 

<ClientSettings>

 

 

<Scrolling AllowScroll="True" UseStaticHeaders="true"/>

 

 

</ClientSettings>

 

 

</telerik:RadGrid>

 

0
Vlad
Telerik team
answered on 17 Nov 2008, 01:10 PM
Hi Mike,

I tried to reproduce this however everything worked find. Can you please try to reproduce the exception in the attached project?

Regards,
Vlad
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Mike Eaton
Top achievements
Rank 1
answered on 11 Dec 2008, 11:36 AM
Hi,

I have only just had time to try out your test project - I got it to work fine but when I put it into my own project I got the error again. I eventually traced it to being caused only when I put the grid in a Content page rather than a standard web page. It also only caused the error in IE6 and 7, Firefox is fine but unfortunatly I need it to work in IE7.

Thanks
0
Mike Eaton
Top achievements
Rank 1
answered on 11 Dec 2008, 11:46 AM
In case this is part of the cause - I am using Telerik controls version 2008.2.826.20 and Microsoft Web Extenstions version 1.0.61025.0 in.net 2.0 framework
0
Accepted
Rosen
Telerik team
answered on 15 Dec 2008, 06:09 PM
Hello Mike Eaton,

Indeed I was able to recreate the error with the additional details. I have found the this behavior is caused by the RadGrid's id. When used in masterpage scenario or placed inside another namingcontatiner the id of the grid is prefixed with underscore. Therefore in your scenario the grid will be named "_DetailGrid", unfortunately the "_Detail" is reserved by RadGrid for naming the detailTables and cannot be used as part of the control's name. Thus I suggest you if appropriate to choose another name for the control.

Sincerely yours,
Rosen
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Mike Eaton
Top achievements
Rank 1
answered on 08 Jan 2009, 11:54 AM
Hi, I have just had time to try out changeing the Grid's name and you are correct that this was the problem,

thank you very much!
Tags
Grid
Asked by
Mike Eaton
Top achievements
Rank 1
Answers by
Vlad
Telerik team
Mike Eaton
Top achievements
Rank 1
Rosen
Telerik team
Share this question
or