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

Controls collection cannot be modified error...

1 Answer 14 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Ken
Top achievements
Rank 1
Ken asked on 17 Nov 2008, 06:50 AM

So, I've seen a number of posts related to this and all of them seemed to be related to control blocks added to JS inside of controls...but, that's not my problem. For whatever reason, control blocks in unrelated non-server-side div tags seem to be causing the same error. See the code below. If I remove the <div> tags with the resource pulls, it works. If I remove the RadAjaxManager or if I switch the string drops into Literals, the error goes away. What's up with that? Those divs aren't being run at the server side so they shouldn't be included as controls.

This is with your 2008 AJAX grid control running on .Net 3.5 SP1, VS 2k5 using the built-in dev server.

 

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="imATHLETE.account.WebForm1" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>Untitled Page</title>
</head>
<body>
 
 <form id="whatever" runat="server">
 <telerik:RadStyleSheetManager ID="RadStyleSheetManager1" runat="server">
 </telerik:RadStyleSheetManager>

 
   <asp:SqlDataSource ID="imATHLETEDBNet" runat="server" ConnectionString="<%$ ConnectionStrings:imATHLETEDBNet %>"
     SelectCommand="usp_get_EventParticipantList" SelectCommandType="StoredProcedure">
     <SelectParameters>
      <asp:QueryStringParameter DefaultValue="0" Name="inEventID" QueryStringField="fEventDisplayID"
       Type="Int32" />
      <asp:Parameter Name="inUserID" Type="Int32" DefaultValue="1043" />
      <asp:Parameter DefaultValue="0" Name="inFormatXML" Type="Int16" />
     </SelectParameters>
    </asp:SqlDataSource>
    &nbsp;&nbsp;
    
 
 <div class="PageHeader">
   <%=Resources.Strings_EN_US.RDPartiDetailsPageTitle %>
   <span style="color: #CCCCCC;">&nbsp;&gt;&nbsp;<%=Resources.Strings_EN_US.RDPartiDetailsPageTitle2 %></span>
  </div>
  
  <div id="ParticipantDetails_EventSelect">
   <h3><%=Resources.Strings_EN_US.RDPartiDetailsSelectEvent %></h3>
   <select name="fEventDisplayID" id="fEventDisplayID">
    
   </select>
  </div>
 
  <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
 </telerik:RadScriptManager>
 
   <telerik:RadGrid ID="RadGrid1" runat="server" AllowFilteringByColumn="True" AllowPaging="True" AllowSorting="True" DataSourceID="imATHLETEDBNet" GridLines="None" Skin="Outlook" AutoGenerateDeleteColumn="True" AutoGenerateEditColumn="True">
     <HeaderContextMenu EnableTheming="True" Skin="Outlook">
      <CollapseAnimation Duration="200" Type="OutQuint" />
     </HeaderContextMenu>
     <MasterTableView AutoGenerateColumns="False" DataSourceID="imATHLETEDBNet">
      <RowIndicatorColumn>
       <HeaderStyle Width="20px" />
      </RowIndicatorColumn>
      <ExpandCollapseColumn>
       <HeaderStyle Width="20px" />
      </ExpandCollapseColumn>
      <Columns>
       <telerik:GridBoundColumn DataField="XML_F52E2B61-18A1-11d1-B105-00805F49916B" HeaderText="XML_F52E2B61-18A1-11d1-B105-00805F49916B"
        ReadOnly="True" SortExpression="XML_F52E2B61-18A1-11d1-B105-00805F49916B" UniqueName="XML_F52E2B61-18A1-11d1-B105-00805F49916B">
       </telerik:GridBoundColumn>
      </Columns>
     </MasterTableView>
     <ClientSettings AllowColumnsReorder="True" ReorderColumnsOnClient="True">
      <Selecting AllowRowSelect="True" />
      <Scrolling AllowScroll="True" UseStaticHeaders="True" />
     </ClientSettings>
     <FilterMenu EnableTheming="True" Skin="Outlook">
      <CollapseAnimation Duration="200" Type="OutQuint" />
     </FilterMenu>
    </telerik:RadGrid>
  <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
   <AjaxSettings>
    <telerik:AjaxSetting AjaxControlID="RadGrid1">
     <UpdatedControls>
      <telerik:AjaxUpdatedControl ControlID="RadGrid1" />
     </UpdatedControls>
    </telerik:AjaxSetting>
   </AjaxSettings>
  </telerik:RadAjaxManager>
    </form>
</body>
</html>

 

 

 

 

1 Answer, 1 is accepted

Sort by
0
Vlad
Telerik team
answered on 17 Nov 2008, 07:51 AM
Hello Ken,

You can wrap these divs with RadCodeBlock to avoid the error.

Greetings,
Vlad
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
Grid
Asked by
Ken
Top achievements
Rank 1
Answers by
Vlad
Telerik team
Share this question
or