Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
2589
Error using Grid
posted

Hello,

I saw the same questions on this forum but they have had not replies so I'm asking the question again.

This is what I get when try to run app with grid:

The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>).

I set DataSource property from codebehind and data source is a simple dataset. 

Any ideas? I use v10.3

Thank you.

Parents
No Data
Reply
  • 575
    posted

    I am getting this same error.  This is my markup and im binding to a anonymous type, but it shouldn't matter.

      <div align="center" style="width: 100%" >
                    <table>
                        <ig:WebGroupBox ID="wgbPayOnInvoice" runat="server" Text="Pay On Invoice" Width="98%">
                            <Template>
                       
                             <ig:WebDataGrid ID="wdgPayOnInvoice" DataKeyFields="IKey" runat="server" AutoGenerateColumns="true"
                                    Height="350px" Width="100%">
                                    <Columns>
                                        <ig:BoundDataField Key="IKey" DataFieldName="IKey" Hidden="true" />
                                        <ig:BoundDataField Key="BillNumber" DataFieldName="BillNumber">
                                            <Header Text="Bill Number" />
                                        </ig:BoundDataField>
                                        <ig:BoundDataField Key="LabCode" DataFieldName="LabCode">
                                            <Header Text="Lab" />
                                        </ig:BoundDataField>
                                        <ig:BoundDataField Key="InvoiceNumber" DataFieldName="InvoiceNumber">
                                            <Header Text="Invoice Number" />
                                        </ig:BoundDataField>
                                        <ig:BoundDataField Key="TransactionAmount" DataFieldName="TransactionAmount" DataFormatString="{0:C0}">
                                            <Header Text="Total" />
                                        </ig:BoundDataField>
                                        <ig:BoundDataField Key="Balance" DataFieldName="Balance" DataFormatString="{0:C0}">
                                            <Header Text="Balance" />
                                        </ig:BoundDataField>
                                    </Columns>
                                </ig:WebDataGrid>              
                            </Template>
                        </ig:WebGroupBox>
                    </table>
                </div>

     

    This is the full error.

    Server Error in '/AHCP.WebUI' Application.

    The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>).

    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.Web.HttpException: The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>).

    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:

    [HttpException (0x80004005): The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>).]
       System.Web.UI.ControlCollection.Add(Control child) +11035338
       Infragistics.Web.UI.Framework.AppStyling.CssBuilder.OnPreRenderComplete(Object sender, EventArgs e) +646
       System.EventHandler.Invoke(Object sender, EventArgs e) +0
       System.Web.UI.Page.OnPreRenderComplete(EventArgs e) +11057422
       System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3672
    


    Version Information: Microsoft .NET Framework Version:2.0.50727.5444; ASP.NET Version:2.0.50727.5420

     

     

    Anyone have any ideas?

Children