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
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.
<
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>
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.
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
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.
thank you very much!