Hi,
I am using the Q2 2013 release (2013.2.611.45) version of your controls. On the page I have two databound combos and a grid. The datasource for the grid uses control parameters linked to the two dropdowns. If the grid is in any other EditMode other than Batch, everything works as expected. Both dropdowns have code in the databound event to either select a specific item or add a 'Choose' item.
The grid is empty on initial page load and then once a Form is chosens from the dropdown it then populates with a list of pupils.
If I put the grid into Batch EditMode then when I select a form from the dropdown I get the following error:
Exception Details: System.InvalidOperationException: Collection was modified; enumeration operation may not execute.
Source Error:
Stack Trace:
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.18044
I have tried deleting the grid and rebuilding using the configuration tools, same result. Here is my grid and code behind, also I am using a custom skin set at application level in the web.config and a formdecorator.
Any ideas gratefully received.
Thanks
Chris
I am using the Q2 2013 release (2013.2.611.45) version of your controls. On the page I have two databound combos and a grid. The datasource for the grid uses control parameters linked to the two dropdowns. If the grid is in any other EditMode other than Batch, everything works as expected. Both dropdowns have code in the databound event to either select a specific item or add a 'Choose' item.
The grid is empty on initial page load and then once a Form is chosens from the dropdown it then populates with a list of pupils.
If I put the grid into Batch EditMode then when I select a form from the dropdown I get the following error:
Collection was modified; enumeration operation may not execute.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.Exception Details: System.InvalidOperationException: Collection was modified; enumeration operation may not execute.
Source Error:
An unhandled exception was generated during the execution of the current
web request. Information regarding the origin and location of the
exception can be identified using the exception stack trace below.
|
Stack Trace:
|
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.18044
I have tried deleting the grid and rebuilding using the configuration tools, same result. Here is my grid and code behind, also I am using a custom skin set at application level in the web.config and a formdecorator.
<%@ Page Title="Stars Pluses Minuses" Language="C#" MasterPageFile="~/Staff/Staff.master" AutoEventWireup="true" CodeFile="StarsPlusMinus.aspx.cs" Inherits="Staff.Reporting.AR.StarsPlusMinus" %><asp:Content ID="Content1" ContentPlaceHolderID="head_staff" Runat="Server"></asp:Content><asp:Content ID="Content2" ContentPlaceHolderID="main_staff" Runat="Server"> <asp:Panel ID="SelectionPanel" runat="server" CssClass="SelectionPanel"> <telerik:RadComboBox ID="FormComboBox" runat="server" Label="Form: " Width="150px" CssClass="PupilChooserCombo" AutoPostBack="True" OnDataBound="FormComboBox_OnDataBound" DataSourceID="FormDataSource" DataTextField="DESCRIPTION" DataValueField="CODE"> </telerik:RadComboBox> <telerik:RadComboBox ID="PeriodComboBox" runat="server" Label="Period: " Width="150px" CssClass="PupilChooserCombo" AutoPostBack="True" DataSourceID="PeriodDataSource" DataTextField="PERIOD_NAME" DataValueField="PERIOD_ID" OnDataBound="PeriodComboBox_DataBound"> </telerik:RadComboBox> </asp:Panel> <telerik:RadGrid ID="PupilGrid" runat="server" AllowAutomaticUpdates="True" AutoGenerateColumns="False" CellSpacing="0" DataSourceID="GridDataSource" GridLines="None"> <ExportSettings> <Pdf> <PageHeader> <LeftCell Text=""></LeftCell> <MiddleCell Text=""></MiddleCell> <RightCell Text=""></RightCell> </PageHeader> <PageFooter> <LeftCell Text=""></LeftCell> <MiddleCell Text=""></MiddleCell> <RightCell Text=""></RightCell> </PageFooter> </Pdf> </ExportSettings> <ValidationSettings EnableModelValidation="False" EnableValidation="False" /> <MasterTableView ClientDataKeyNames="LINE_ID" CommandItemDisplay="TopAndBottom" DataKeyNames="LINE_ID" DataSourceID="GridDataSource" EditMode="Batch" ShowHeadersWhenNoRecords="True"> <CommandItemSettings ExportToPdfText="Export to PDF" ShowAddNewRecordButton="False" ShowCancelChangesButton="True" ShowRefreshButton="False" ShowSaveChangesButton="True"></CommandItemSettings> <RowIndicatorColumn FilterControlAltText="Filter RowIndicator column"> <HeaderStyle Width="20px"></HeaderStyle> </RowIndicatorColumn> <ExpandCollapseColumn Visible="True" FilterControlAltText="Filter ExpandColumn column" Created="True"> <HeaderStyle Width="20px"></HeaderStyle> </ExpandCollapseColumn> <Columns> <telerik:GridBoundColumn DataField="INFORMAL_NAME" FilterControlAltText="Filter INFORMAL_NAME column" HeaderText="INFORMAL_NAME" ReadOnly="True" SortExpression="INFORMAL_NAME" UniqueName="INFORMAL_NAME"> <ColumnValidationSettings> <ModelErrorMessage Text="" /> </ColumnValidationSettings> </telerik:GridBoundColumn> <telerik:GridBoundColumn ReadOnly="True" DataField="ACADEMIC_HOUSE_DESCRIPTION" FilterControlAltText="Filter ACADEMIC_HOUSE_DESCRIPTION column" HeaderText="ACADEMIC_HOUSE_DESCRIPTION" SortExpression="ACADEMIC_HOUSE_DESCRIPTION" UniqueName="ACADEMIC_HOUSE_DESCRIPTION"> <ColumnValidationSettings> <ModelErrorMessage Text="" /> </ColumnValidationSettings> </telerik:GridBoundColumn> <telerik:GridBoundColumn ReadOnly="True" DataField="FORM_DESC" FilterControlAltText="Filter FORM_DESC column" HeaderText="FORM_DESC" SortExpression="FORM_DESC" UniqueName="FORM_DESC"> <ColumnValidationSettings> <ModelErrorMessage Text="" /> </ColumnValidationSettings> </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="STARS" DataType="System.Decimal" FilterControlAltText="Filter STARS column" HeaderText="STARS" SortExpression="STARS" UniqueName="STARS"> <ColumnValidationSettings> <ModelErrorMessage Text="" /> </ColumnValidationSettings> </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="PLUSES" DataType="System.Decimal" FilterControlAltText="Filter PLUSES column" HeaderText="PLUSES" SortExpression="PLUSES" UniqueName="PLUSES"> <ColumnValidationSettings> <ModelErrorMessage Text="" /> </ColumnValidationSettings> </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="MINUSES" DataType="System.Decimal" FilterControlAltText="Filter MINUSES column" HeaderText="MINUSES" ReadOnly="True" SortExpression="MINUSES" UniqueName="MINUSES"> <ColumnValidationSettings> <ModelErrorMessage Text="" /> </ColumnValidationSettings> </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="LINE_ID" DataType="System.Int32" FilterControlAltText="Filter LINE_ID column" HeaderText="LINE_ID" ReadOnly="True" SortExpression="LINE_ID" UniqueName="LINE_ID"> <ColumnValidationSettings> <ModelErrorMessage Text="" /> </ColumnValidationSettings> </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="HEADER_ID" DataType="System.Int32" FilterControlAltText="Filter HEADER_ID column" HeaderText="HEADER_ID" SortExpression="HEADER_ID" UniqueName="HEADER_ID"> <ColumnValidationSettings> <ModelErrorMessage Text="" /> </ColumnValidationSettings> </telerik:GridBoundColumn> </Columns> <EditFormSettings> <EditColumn FilterControlAltText="Filter EditCommandColumn column"></EditColumn> </EditFormSettings> <BatchEditingSettings EditType="Cell"></BatchEditingSettings> <PagerStyle PageSizeControlType="RadComboBox"></PagerStyle> </MasterTableView> <PagerStyle PageSizeControlType="RadComboBox"></PagerStyle> <FilterMenu EnableImageSprites="False"></FilterMenu> </telerik:RadGrid> <asp:SqlDataSource ID="FormDataSource" runat="server" ConnectionString="<%$ ConnectionStrings:PassMainConnectionString %>" SelectCommand="usps_SA_GetForms" SelectCommandType="StoredProcedure"> <SelectParameters> <asp:ProfileParameter Name="ACADEMIC_YEAR" PropertyName="CurrentAcademicYear" Type="Int32" /> </SelectParameters> </asp:SqlDataSource> <asp:SqlDataSource ID="PeriodDataSource" runat="server" ConnectionString="<%$ ConnectionStrings:PassMainConnectionString %>" SelectCommand="usps_SA_GetAssessmentPeriods" SelectCommandType="StoredProcedure"> <SelectParameters> <asp:ProfileParameter Name="ACADEMIC_YEAR" PropertyName="CurrentAcademicYear" Type="Int32" /> </SelectParameters> </asp:SqlDataSource> <asp:SqlDataSource ID="GridDataSource" runat="server" ConnectionString="<%$ ConnectionStrings:PassMainConnectionString %>" SelectCommand="usps_SA_GetPupilsForSPMGrid" SelectCommandType="StoredProcedure"> <SelectParameters> <asp:Parameter Name="SCHOOL" Type="String" DefaultValue="SA"/> <asp:ControlParameter ControlID="PeriodComboBox" Name="PERIOD_ID" PropertyName="SelectedValue" Type="Int32" /> <asp:ControlParameter ControlID="FormComboBox" Name="FORM_CODE" PropertyName="SelectedValue" Type="String" /> <asp:ProfileParameter Name="ACADEMIC_YEAR" PropertyName="CurrentAcademicYear" Type="Int32" /> </SelectParameters> </asp:SqlDataSource></asp:Content>using System;using System.Linq;using NLog;using Telerik.Web.UI;namespace Staff.Reporting.AR{ public partial class StarsPlusMinus : System.Web.UI.Page { private readonly Logger _logger = LogManager.GetCurrentClassLogger(); protected void Page_Error(object sender, EventArgs e) { Exception ex = Server.GetLastError(); _logger.Fatal(ex); Server.ClearError(); //store exception to display some details to the user Session[Profile.DomainUsername + "LastError"] = ex; Response.Redirect("/Staff/StaffError.aspx", true); } protected void Page_Load(object sender, EventArgs e) { } protected void PeriodComboBox_DataBound(object sender, EventArgs e) { if (IsPostBack) return; //always select the current period on first visit var item = PeriodComboBox.Items.FirstOrDefault(i => i.Text.EndsWith("(*)")); if (item != null) item.Selected = true; } protected void FormComboBox_OnDataBound(object sender, EventArgs e) { if (IsPostBack) return; FormComboBox.Items.Insert(0, new RadComboBoxItem("Choose ...", "XX") { Selected = true }); } }}<telerik:RadFormDecorator ID="RadFormDecorator1" runat="server" ControlsToSkip="None" DecoratedControls="All" Skin="MyCustomSkin" />Any ideas gratefully received.
Thanks
Chris