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

RadAjaxManager - Collection was modified error

3 Answers 217 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
David
Top achievements
Rank 1
David asked on 12 Sep 2014, 08:50 PM
Hello


I have a RadComboBox that updates two RadGrids, each with a detail table that has a command button which opens a different RadWindow containing another RadGrid, and I'm running into errors when trying to apply RadAjaxManager controls to the page. Everything is working fine until I set the second grid (uxRolesRG)  to update its window (RoleAvailUsers), which causes the page to throw a JScript runtime error whenever a new value is selected in the RadComboBox.



Error:
0x800a139e - Microsoft JScript runtime error: Sys.WebForms.PageRequestManagerServerErrorException: Collection was modified; enumeration operation may not execute.
 
If there is a handler for this exception, the program may be safely continued.


Default.aspx:
<%@ Page Title="" Language="VB" MasterPageFile="~/MasterPage.master" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="Applications_Default" %>
 
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="Server">
    <telerik:RadScriptBlock ID="RSBlock1" runat="server">
        <script type="text/javascript">
            function ShowAddRoleWindow(sender, args) {
                $find("<%=AddUserRoleRW.ClientID%>").show();
            }
 
            function ShowAddUserWindow(sender, args) {
                $find("<%=AddRoleUserRW.ClientID%>").show();
            }
        </script>
    </telerik:RadScriptBlock>
    <telerik:RadAjaxManager ID="uxAjaxManager" runat="server">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="uxAppSelectCB">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="uxUserRG" />
                    <telerik:AjaxUpdatedControl ControlID="uxRolesRG" />
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="uxUserRG">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="UserAvailRoles" LoadingPanelID="UserAvailRolesLW" />
                    <telerik:AjaxUpdatedControl ControlID="AddUserRoleUN" />
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="uxRolesRG">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RoleAvailUsers" LoadingPanelID="RoleAvailUsersLW" />
                    <telerik:AjaxUpdatedControl ControlID="AddRoleUserUN" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>
    <asp:Label ID="AddUserRoleUN" runat="server" Visible="false" />
    <asp:Label ID="AddRoleUserUN" runat="server" Visible="false" />
    <telerik:RadComboBox ID="uxAppSelectCB" AllowCustomText="true" runat="server" DataSourceID="AppListODS" DataValueField="ApplicationId" DataTextField="ApplicationName" MarkFirstMatch="true" AutoPostBack="true" />
    <telerik:RadWindow ID="AddUserRoleRW" runat="server">
        <ContentTemplate>
            <telerik:RadAjaxLoadingPanel ID="UserAvailRolesLW" runat="server" />
            <telerik:RadGrid ID="UserAvailRoles" runat="server" DataSourceID="UserRolesUnassignedODS" AutoGenerateColumns="false" AllowAutomaticUpdates="true" AllowAutomaticInserts="false">
                <MasterTableView EditMode="Batch" DataKeyNames="RoleId" CommandItemDisplay="Top" AllowPaging="true" PageSize="40">
                    <BatchEditingSettings OpenEditingEvent="MouseOver" />
                    <CommandItemSettings ShowAddNewRecordButton="false" ShowRefreshButton="false" />
                    <Columns>
                        <telerik:GridCheckBoxColumn UniqueName="GrantCB" HeaderStyle-Width="30px" DataField="IsSelected" />
                        <telerik:GridBoundColumn DataField="RoleName" HeaderText="Role" ReadOnly="true" />
                    </Columns>
                </MasterTableView>
            </telerik:RadGrid>
        </ContentTemplate>
    </telerik:RadWindow>
    <telerik:RadWindow ID="AddRoleUserRW" runat="server">
        <ContentTemplate>
            <telerik:RadAjaxLoadingPanel ID="RoleAvailUsersLW" runat="server" />
            <telerik:RadGrid ID="RoleAvailUsers" runat="server" DataSourceID="RoleUsersUnassignedODS" AutoGenerateColumns="false" AllowAutomaticUpdates="true" AllowAutomaticInserts="false">
                <MasterTableView EditMode="Batch" DataKeyNames="UserId" CommandItemDisplay="Top" AllowPaging="true" PageSize="40">
                    <BatchEditingSettings OpenEditingEvent="MouseOver" />
                    <CommandItemSettings ShowAddNewRecordButton="false" ShowRefreshButton="false" />
                    <Columns>
                        <telerik:GridCheckBoxColumn UniqueName="AddCB" HeaderStyle-Width="30px" DataField="IsSelected" />
                        <telerik:GridBoundColumn DataField="FirstName" HeaderText="First Name" ReadOnly="true" />
                        <telerik:GridBoundColumn DataField="LastName" HeaderText="Last Name" ReadOnly="true" />
                        <telerik:GridBoundColumn DataField="UserName" HeaderText="User Name" ReadOnly="true" />
                    </Columns>
                </MasterTableView>
            </telerik:RadGrid>
        </ContentTemplate>
    </telerik:RadWindow>
    <telerik:RadTabStrip runat="server" ID="uxAdminModeStrip" Orientation="HorizontalTop" SelectedIndex="0" MultiPageID="uxAdminModeMP">
        <Tabs>
            <telerik:RadTab Text="Manage By User" TabIndex="0" />
            <telerik:RadTab Text="Manage By Role" TabIndex="1" />
        </Tabs>
    </telerik:RadTabStrip>
    <telerik:RadMultiPage runat="server" ID="uxAdminModeMP" SelectedIndex="0" Width="100%">
 
        <%--Page: By User--%>
        <telerik:RadPageView runat="server" ID="uxByUserPV" TabIndex="0">
            <telerik:RadGrid ID="uxUserRG" runat="server" DataSourceID="UserListODS" AutoGenerateColumns="false">
                <MasterTableView DataKeyNames="UserId" AllowFilteringByColumn="true" AllowSorting="true">
                    <DetailTables>
                        <telerik:GridTableView DataKeyNames="RoleId" Name="uxUserRolesRG" AutoGenerateColumns="false" runat="server" DataSourceID="UserRolesODS" AllowAutomaticDeletes="true" CommandItemDisplay="Top">
                            <CommandItemTemplate>
                                <telerik:RadButton ID="AddUserRoleRB" runat="server" CommandName="AddRoles" OnClientClicked="ShowAddRoleWindow" AutoPostBack="true" Text="Add Roles" ButtonType="SkinnedButton" />
                            </CommandItemTemplate>
                            <CommandItemSettings ShowAddNewRecordButton="false" />
                            <ParentTableRelation>
                                <telerik:GridRelationFields DetailKeyField="UserId" MasterKeyField="UserId" />
                            </ParentTableRelation>
                            <Columns>
                                <telerik:GridBoundColumn DataField="RoleName" HeaderText="Role Name" ReadOnly="true" />
                                <telerik:GridBoundColumn DataField="Description" HeaderText="Description" ReadOnly="true" />
                                <telerik:GridButtonColumn CommandName="Delete" HeaderText="Remove" ButtonType="PushButton" Text="X" />
                            </Columns>
                        </telerik:GridTableView>
                    </DetailTables>
                    <Columns>
                        <telerik:GridBoundColumn DataField="UserName" HeaderText="User Name" CurrentFilterFunction="Contains" AutoPostBackOnFilter="true" />
                        <telerik:GridBoundColumn DataField="FirstName" HeaderText="First Name" CurrentFilterFunction="Contains" AutoPostBackOnFilter="true" />
                        <telerik:GridBoundColumn DataField="LastName" HeaderText="Last Name" CurrentFilterFunction="Contains" AutoPostBackOnFilter="true" />
                        <telerik:GridCheckBoxColumn DataField="IsLockedOut" HeaderText="Locked" AllowFiltering="false" />
                        <telerik:GridCheckBoxColumn DataField="IsArchive" HeaderText="Archived" AllowFiltering="false" />
                        <telerik:GridDateTimeColumn DataField="LastActivityDate" HeaderText="Last Active" DataFormatString="{0:dd/MM/yyyy}" CurrentFilterFunction="GreaterThanOrEqualTo" AutoPostBackOnFilter="true" />
                    </Columns>
                </MasterTableView>
                <GroupingSettings CaseSensitive="false" />
            </telerik:RadGrid>
        </telerik:RadPageView>
 
        <%--Page: By Role--%>
        <telerik:RadPageView runat="server" ID="uxByRolePV" TabIndex="1">
            <telerik:RadGrid ID="uxRolesRG" runat="server" DataSourceID="RoleListODS" AutoGenerateColumns="false">
                <MasterTableView DataKeyNames="RoleId" AllowFilteringByColumn="true" AllowSorting="true">
                    <DetailTables>
                        <telerik:GridTableView DataKeyNames="UserId" Name="uxRoleUsersRG" AutoGenerateColumns="false" runat="server" DataSourceID="RoleUsersODS" AllowAutomaticDeletes="true" CommandItemDisplay="top">
                            <CommandItemTemplate>
                                <telerik:RadButton ID="AddRoleUserRB" runat="server" CommandName="AddUsers" OnClientClicked="ShowAddUserWindow" AutoPostBack="true" Text="Add Users" ButtonType="SkinnedButton" />
                            </CommandItemTemplate>
                            <CommandItemSettings ShowAddNewRecordButton="false" />
                            <ParentTableRelation>
                                <telerik:GridRelationFields DetailKeyField="RoleId" MasterKeyField="RoleId" />
                            </ParentTableRelation>
                            <Columns>
                                <telerik:GridBoundColumn DataField="UserName" HeaderText="User Name" />
                                <telerik:GridBoundColumn DataField="FirstName" HeaderText="First Name" />
                                <telerik:GridBoundColumn DataField="LastName" HeaderText="Last Name" />
                                <telerik:GridCheckBoxColumn DataField="IsLockedOut" HeaderText="Locked" />
                                <telerik:GridCheckBoxColumn DataField="IsArchive" HeaderText="Archived" />
                                <telerik:GridDateTimeColumn DataField="LastActivityDate" HeaderText="Last Active" DataFormatString="{0:dd/MM/yyyy}" />
                                <telerik:GridButtonColumn CommandName="Delete" HeaderText="Remove" ButtonType="PushButton" Text="X" />
                            </Columns>
                        </telerik:GridTableView>
                    </DetailTables>
                    <Columns>
                        <telerik:GridBoundColumn DataField="RoleName" HeaderText="Role Name" CurrentFilterFunction="Contains" AutoPostBackOnFilter="true" />
                        <telerik:GridBoundColumn DataField="Description" HeaderText="Description" CurrentFilterFunction="Contains" AutoPostBackOnFilter="true" />
                        <telerik:GridCheckBoxColumn DataField="IsActive" HeaderText="Active" AllowFiltering="false" />
                        <telerik:GridCheckBoxColumn DataField="IsLocked" HeaderText="Locked" AllowFiltering="false" />
                        <telerik:GridDateTimeColumn DataField="CreateDate" HeaderText="Created" DataFormatString="{0:dd/MM/yyyy}" CurrentFilterFunction="GreaterThanOrEqualTo" AutoPostBackOnFilter="true" />
                        <telerik:GridDateTimeColumn DataField="ModifyDate" HeaderText="Modified" DataFormatString="{0:dd/MM/yyyy}" CurrentFilterFunction="GreaterThanOrEqualTo" AutoPostBackOnFilter="true" />
                    </Columns>
                </MasterTableView>
                <GroupingSettings CaseSensitive="false" />
            </telerik:RadGrid>
        </telerik:RadPageView>
    </telerik:RadMultiPage>
 
    <%--ODS For Dropdown--%>
    <asp:ObjectDataSource ID="AppListODS" runat="server" TypeName="Applications" SelectMethod="GetApplicationsWithAccessRights" />
 
    <%--ODS For Base Grids--%>
    <asp:ObjectDataSource ID="UserListODS" runat="server" TypeName="Applications" SelectMethod="GetApplicationUsers">
        <SelectParameters>
            <asp:ControlParameter ControlID="uxAppSelectCB" Name="ApplicationId" />
        </SelectParameters>
    </asp:ObjectDataSource>
    <asp:ObjectDataSource ID="RoleListODS" runat="server" TypeName="Applications" SelectMethod="GetApplicationRoles">
        <SelectParameters>
            <asp:ControlParameter ControlID="uxAppSelectCB" Name="ApplicationId" />
        </SelectParameters>
    </asp:ObjectDataSource>
 
    <%--ODS For Detail Tables--%>
    <asp:ObjectDataSource ID="UserRolesODS" runat="server" TypeName="Applications" SelectMethod="GetUserApplicationRoles" DeleteMethod="DeleteUserRole">
        <SelectParameters>
            <asp:ControlParameter ControlID="uxAppSelectCB" Name="ApplicationId" />
            <asp:Parameter Name="UserId" />
        </SelectParameters>
        <DeleteParameters>
            <asp:Parameter Name="UserId" />
            <asp:Parameter Name="RoleId" />
        </DeleteParameters>
    </asp:ObjectDataSource>
    <asp:ObjectDataSource ID="RoleUsersODS" runat="server" TypeName="Applications" SelectMethod="GetUsersWithRole" DeleteMethod="DeleteRoleUser">
        <SelectParameters>
            <asp:Parameter Name="RoleId" />
        </SelectParameters>
        <DeleteParameters>
            <asp:Parameter Name="UserId" />
            <asp:Parameter Name="RoleId" />
        </DeleteParameters>
    </asp:ObjectDataSource>
 
    <%--ODS For Add Window--%>
    <asp:ObjectDataSource ID="UserRolesUnassignedODS" runat="server" TypeName="Applications" SelectMethod="GetUserUngrantedRoles" UpdateMethod="BatchInsertUserRole">
        <SelectParameters>
            <asp:ControlParameter ControlID="uxAppSelectCB" Name="ApplicationId" />
            <asp:Parameter Name="UserId" />
        </SelectParameters>
        <UpdateParameters>
            <asp:ControlParameter ControlID="AddUserRoleUN" Name="UserId" />
        </UpdateParameters>
    </asp:ObjectDataSource>
    <asp:ObjectDataSource ID="RoleUsersUnassignedODS" runat="server" TypeName="Applications" SelectMethod="GetRoleUngrantedUsers" UpdateMethod="BatchInsertRoleUser">
        <SelectParameters>
            <asp:Parameter Name="RoleId" />
        </SelectParameters>
        <UpdateParameters>
            <asp:ControlParameter ControlID="AddRoleUserUN" Name="RoleId" />
        </UpdateParameters>
    </asp:ObjectDataSource>
</asp:Content>



Default.aspx.vb
Imports Telerik.Web.UI
 
Partial Class Applications_Default
    Inherits System.Web.UI.Page
 
    Protected Sub Page_Init(sender As Object, e As EventArgs) Handles Me.Init
        If Not Page.IsPostBack Then
            uxAppSelectCB.SelectedIndex = 0
            uxRolesRG.Rebind()
            uxUserRG.Rebind()
        End If
    End Sub
 
    Protected Sub uxUserRG_ItemCommand(sender As Object, e As GridCommandEventArgs) Handles uxUserRG.ItemCommand
        If e.Item.OwnerTableView.DataSourceID.Equals("UserRolesODS") Then
            Dim UserId = e.Item.OwnerTableView.ParentItem.GetDataKeyValue("UserId").ToString()
            If e.CommandName.Equals("Delete") Then
                UserRolesODS.DeleteParameters("UserId").DefaultValue = UserId
            ElseIf e.CommandName.Equals("AddRoles") Then
                UserRolesUnassignedODS.SelectParameters("UserId").DefaultValue = UserId
                AddUserRoleUN.Text = UserId
                UserAvailRoles.Rebind()
            End If
        End If
    End Sub
 
 
    Protected Sub uxRolesRG_ItemCommand(sender As Object, e As GridCommandEventArgs) Handles uxRolesRG.ItemCommand
        If e.Item.OwnerTableView.DataSourceID.Equals("RoleUsersODS") Then
            Dim RoleId = e.Item.OwnerTableView.ParentItem.GetDataKeyValue("RoleId").ToString()
            If e.CommandName.Equals("Delete") Then
                RoleUsersODS.DeleteParameters("RoleId").DefaultValue = RoleId
            ElseIf e.CommandName.Equals("AddUsers") Then
                RoleUsersUnassignedODS.SelectParameters("RoleId").DefaultValue = RoleId
                AddRoleUserUN.Text = RoleId
                RoleAvailUsers.Rebind()
            End If
        End If
    End Sub
End Class



3 Answers, 1 is accepted

Sort by
0
Maria Ilieva
Telerik team
answered on 17 Sep 2014, 01:55 PM
Hello David,

Please note that ajaxifying a  single PageView or a control added in PageView could not be added as AJAX initiator or updated control in the AJAX settings. The only possible approach is to add the whole MultiPage in the RadAjaxManager settings. When we set the MultiPage as an updated control, you should also include the TabStrip associated with it in the Ajax settings. Therefore the best option would be to wrap the both controls into single wrapper and use this wrapper into the RadAjaxManager settings.
Also note that the RadAjaxLoadingPanel should not be added as updated control in the ajax settings.

Based on these suggestions try modifying the provided code like this:
<telerik:RadAjaxManager ID="uxAjaxManager" runat="server">
       <AjaxSettings>
           <telerik:AjaxSetting AjaxControlID="uxAppSelectCB">
               <UpdatedControls>
                   <telerik:AjaxUpdatedControl ControlID="TabPanel" />
               </UpdatedControls>
           </telerik:AjaxSetting>
           <telerik:AjaxSetting AjaxControlID="TabPanel">
               <UpdatedControls>
                   <telerik:AjaxUpdatedControl ControlID="UserAvailRoles" LoadingPanelID="UserAvailRolesLW" />
                   <telerik:AjaxUpdatedControl ControlID="AddUserRoleUN" />
               </UpdatedControls>
           </telerik:AjaxSetting>
           <telerik:AjaxSetting AjaxControlID="Panel1">
               <UpdatedControls>
                   <telerik:AjaxUpdatedControl ControlID="RoleAvailUsers" LoadingPanelID="RoleAvailUsersLW" />
                   <telerik:AjaxUpdatedControl ControlID="AddRoleUserUN" />
               </UpdatedControls>
           </telerik:AjaxSetting>
       </AjaxSettings>
   </telerik:RadAjaxManager>
   <asp:Label ID="AddUserRoleUN" runat="server" Visible="false" />
   <asp:Label ID="AddRoleUserUN" runat="server" Visible="false" />
   <telerik:RadAjaxLoadingPanel ID="UserAvailRolesLW" runat="server" />
   <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" />
   <telerik:RadComboBox ID="uxAppSelectCB" AllowCustomText="true" runat="server" DataSourceID="AppListODS" DataValueField="ApplicationId" DataTextField="ApplicationName" MarkFirstMatch="true" AutoPostBack="true" />
   <telerik:RadWindow ID="AddUserRoleRW" runat="server">
       <ContentTemplate>
 
           <telerik:RadGrid ID="UserAvailRoles" runat="server" DataSourceID="UserRolesUnassignedODS" AutoGenerateColumns="false" AllowAutomaticUpdates="true" AllowAutomaticInserts="false">
               <MasterTableView EditMode="Batch" DataKeyNames="RoleId" CommandItemDisplay="Top" AllowPaging="true" PageSize="40">
                   <BatchEditingSettings OpenEditingEvent="MouseOver" />
                   <CommandItemSettings ShowAddNewRecordButton="false" ShowRefreshButton="false" />
                   <Columns>
                       <telerik:GridCheckBoxColumn UniqueName="GrantCB" HeaderStyle-Width="30px" DataField="IsSelected" />
                       <telerik:GridBoundColumn DataField="RoleName" HeaderText="Role" ReadOnly="true" />
                   </Columns>
               </MasterTableView>
           </telerik:RadGrid>
       </ContentTemplate>
   </telerik:RadWindow>
   <telerik:RadWindow ID="AddRoleUserRW" runat="server">
       <ContentTemplate>
 
           <telerik:RadGrid ID="RoleAvailUsers" runat="server" DataSourceID="RoleUsersUnassignedODS" AutoGenerateColumns="false" AllowAutomaticUpdates="true" AllowAutomaticInserts="false">
               <MasterTableView EditMode="Batch" DataKeyNames="UserId" CommandItemDisplay="Top" AllowPaging="true" PageSize="40">
                   <BatchEditingSettings OpenEditingEvent="MouseOver" />
                   <CommandItemSettings ShowAddNewRecordButton="false" ShowRefreshButton="false" />
                   <Columns>
                       <telerik:GridCheckBoxColumn UniqueName="AddCB" HeaderStyle-Width="30px" DataField="IsSelected" />
                       <telerik:GridBoundColumn DataField="FirstName" HeaderText="First Name" ReadOnly="true" />
                       <telerik:GridBoundColumn DataField="LastName" HeaderText="Last Name" ReadOnly="true" />
                       <telerik:GridBoundColumn DataField="UserName" HeaderText="User Name" ReadOnly="true" />
                   </Columns>
               </MasterTableView>
           </telerik:RadGrid>
       </ContentTemplate>
   </telerik:RadWindow>
 
   <asp:Panel runat="server" ID="TabPanel">
       <telerik:RadTabStrip runat="server" ID="uxAdminModeStrip" Orientation="HorizontalTop" SelectedIndex="0" MultiPageID="uxAdminModeMP">
           <Tabs>
               <telerik:RadTab Text="Manage By User" TabIndex="0" />
               <telerik:RadTab Text="Manage By Role" TabIndex="1" />
           </Tabs>
       </telerik:RadTabStrip>
       <telerik:RadMultiPage runat="server" ID="uxAdminModeMP" SelectedIndex="0" Width="100%">
 
           <%--Page: By User--%>
           <telerik:RadPageView runat="server" ID="uxByUserPV" TabIndex="0">
               <telerik:RadGrid ID="uxUserRG" runat="server" DataSourceID="UserListODS" AutoGenerateColumns="false">
                   <MasterTableView DataKeyNames="UserId" AllowFilteringByColumn="true" AllowSorting="true">
                       <DetailTables>
                           <telerik:GridTableView DataKeyNames="RoleId" Name="uxUserRolesRG" AutoGenerateColumns="false" runat="server" DataSourceID="UserRolesODS" AllowAutomaticDeletes="true" CommandItemDisplay="Top">
                               <CommandItemTemplate>
                                   <telerik:RadButton ID="AddUserRoleRB" runat="server" CommandName="AddRoles" OnClientClicked="ShowAddRoleWindow" AutoPostBack="true" Text="Add Roles" ButtonType="SkinnedButton" />
                               </CommandItemTemplate>
                               <CommandItemSettings ShowAddNewRecordButton="false" />
                               <ParentTableRelation>
                                   <telerik:GridRelationFields DetailKeyField="UserId" MasterKeyField="UserId" />
                               </ParentTableRelation>
                               <Columns>
                                   <telerik:GridBoundColumn DataField="RoleName" HeaderText="Role Name" ReadOnly="true" />
                                   <telerik:GridBoundColumn DataField="Description" HeaderText="Description" ReadOnly="true" />
                                   <telerik:GridButtonColumn CommandName="Delete" HeaderText="Remove" ButtonType="PushButton" Text="X" />
                               </Columns>
                           </telerik:GridTableView>
                       </DetailTables>
                       <Columns>
                           <telerik:GridBoundColumn DataField="UserName" HeaderText="User Name" CurrentFilterFunction="Contains" AutoPostBackOnFilter="true" />
                           <telerik:GridBoundColumn DataField="FirstName" HeaderText="First Name" CurrentFilterFunction="Contains" AutoPostBackOnFilter="true" />
                           <telerik:GridBoundColumn DataField="LastName" HeaderText="Last Name" CurrentFilterFunction="Contains" AutoPostBackOnFilter="true" />
                           <telerik:GridCheckBoxColumn DataField="IsLockedOut" HeaderText="Locked" AllowFiltering="false" />
                           <telerik:GridCheckBoxColumn DataField="IsArchive" HeaderText="Archived" AllowFiltering="false" />
                           <telerik:GridDateTimeColumn DataField="LastActivityDate" HeaderText="Last Active" DataFormatString="{0:dd/MM/yyyy}" CurrentFilterFunction="GreaterThanOrEqualTo" AutoPostBackOnFilter="true" />
                       </Columns>
                   </MasterTableView>
                   <GroupingSettings CaseSensitive="false" />
               </telerik:RadGrid>
           </telerik:RadPageView>
 
           <%--Page: By Role--%>
           <telerik:RadPageView runat="server" ID="uxByRolePV" TabIndex="1">
               <telerik:RadGrid ID="uxRolesRG" runat="server" DataSourceID="RoleListODS" AutoGenerateColumns="false">
                   <MasterTableView DataKeyNames="RoleId" AllowFilteringByColumn="true" AllowSorting="true">
                       <DetailTables>
                           <telerik:GridTableView DataKeyNames="UserId" Name="uxRoleUsersRG" AutoGenerateColumns="false" runat="server" DataSourceID="RoleUsersODS" AllowAutomaticDeletes="true" CommandItemDisplay="top">
                               <CommandItemTemplate>
                                   <telerik:RadButton ID="AddRoleUserRB" runat="server" CommandName="AddUsers" OnClientClicked="ShowAddUserWindow" AutoPostBack="true" Text="Add Users" ButtonType="SkinnedButton" />
                               </CommandItemTemplate>
                               <CommandItemSettings ShowAddNewRecordButton="false" />
                               <ParentTableRelation>
                                   <telerik:GridRelationFields DetailKeyField="RoleId" MasterKeyField="RoleId" />
                               </ParentTableRelation>
                               <Columns>
                                   <telerik:GridBoundColumn DataField="UserName" HeaderText="User Name" />
                                   <telerik:GridBoundColumn DataField="FirstName" HeaderText="First Name" />
                                   <telerik:GridBoundColumn DataField="LastName" HeaderText="Last Name" />
                                   <telerik:GridCheckBoxColumn DataField="IsLockedOut" HeaderText="Locked" />
                                   <telerik:GridCheckBoxColumn DataField="IsArchive" HeaderText="Archived" />
                                   <telerik:GridDateTimeColumn DataField="LastActivityDate" HeaderText="Last Active" DataFormatString="{0:dd/MM/yyyy}" />
                                   <telerik:GridButtonColumn CommandName="Delete" HeaderText="Remove" ButtonType="PushButton" Text="X" />
                               </Columns>
                           </telerik:GridTableView>
                       </DetailTables>
                       <Columns>
                           <telerik:GridBoundColumn DataField="RoleName" HeaderText="Role Name" CurrentFilterFunction="Contains" AutoPostBackOnFilter="true" />
                           <telerik:GridBoundColumn DataField="Description" HeaderText="Description" CurrentFilterFunction="Contains" AutoPostBackOnFilter="true" />
                           <telerik:GridCheckBoxColumn DataField="IsActive" HeaderText="Active" AllowFiltering="false" />
                           <telerik:GridCheckBoxColumn DataField="IsLocked" HeaderText="Locked" AllowFiltering="false" />
                           <telerik:GridDateTimeColumn DataField="CreateDate" HeaderText="Created" DataFormatString="{0:dd/MM/yyyy}" CurrentFilterFunction="GreaterThanOrEqualTo" AutoPostBackOnFilter="true" />
                           <telerik:GridDateTimeColumn DataField="ModifyDate" HeaderText="Modified" DataFormatString="{0:dd/MM/yyyy}" CurrentFilterFunction="GreaterThanOrEqualTo" AutoPostBackOnFilter="true" />
                       </Columns>
                   </MasterTableView>
                   <GroupingSettings CaseSensitive="false" />
               </telerik:RadGrid>
           </telerik:RadPageView>
       </telerik:RadMultiPage>
   </asp:Panel>

and verify how it goes.

Regards,
Maria Ilieva
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
David
Top achievements
Rank 1
answered on 18 Sep 2014, 12:37 PM
Using your changes, I get the same "collection was modified" error as before, only I now get it whenever I interact with anything in that panel. I also noticed that the "RoleAvailUsers" RadGrid isn't listed in the updated list for the new asp:panel, instead it's listed in your example as being updated by a control called "Panel1", which doesn't seem to exist in the code. The same error is also thrown if "RoleAvailUsers" is added to the updated control collection for "TabPanel" and the "Panel1" collection is removed. Removing "RoleAvailUsers" entirely from all UpdatedControls collections prevents the error using either of our code, yet prevents the site and that grid from functioning properly.
0
Maria Ilieva
Telerik team
answered on 23 Sep 2014, 06:51 AM
Hi David,

As the suggestion provided so far does not work on your side, I would suggest you to open a regular support ticket and send us a sample runnable version of your application that demonstrates the issue.
Thus we will be able to debug it locally and isolate the application specifics that are causing the error you are facing.

Regards,
Maria Ilieva
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
Ajax
Asked by
David
Top achievements
Rank 1
Answers by
Maria Ilieva
Telerik team
David
Top achievements
Rank 1
Share this question
or