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.
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.
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.
[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
Anyone have any ideas?
I found the issue with my webdatagrid. I removed this from my markup and it worked. Not sure why this is causing a issue.
<ig:BoundDataField Key="IKey" DataFieldName="IKey" Hidden="true" />
Hope this helps.
I just tried all this with WebDataGrid and it runs fine. Problem starts when I try to use WebHierarchicalDatagrid
I got the same error in WebDataGrid. Problem starts when I set Hidden property to true on some columns which contain GUIDs. When all columns are visible, everything is ok. Any ideas?
Do you have any news about this problem?
Hi,
As I said previously, your code looked ok to me. Have you tried upgrading to the latest Service Release for 10.3 to see if the issue is resolved there. Or contact Developer Support so they can walk through your sample and attempt to locate the problem.
thanks,Dave
Thank you for reply.
Now I'm using 2011.1 so problem perhaps somewhere in your code.