2

I am getting an error when using the Infragistics WebDataGrid on my SharePoint site with using only dynamic columns.

The error is: [HttpException]: The controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>).

Can you please help?

    protected void Page_Load(object sender, EventArgs e)
    {
        List<CustomObject> customObjects = new List<CustomObject>();

        CustomObject customObject = new CustomObject();

        customObject.ID = 1;
        customObject.Col1 = "Super Cool Stuff1";
        customObject.Col2 = "Super Cool Stuff2";
        customObject.Col3 = "Super Cool Stuff3";
        customObject.Col4 = "Super Cool Stuff4";

        customObjects.Add(customObject);

        customObject = new CustomObject();
        customObject.ID = 2;
        customObject.Col1 = "Super Cool 1";
        customObject.Col2 = "Super Cool 2";
        customObject.Col3 = "Super Cool 3";
        customObject.Col4 = "Super Cool 4";

        customObjects.Add(customObject);

        this.WebDataGrid1.DataSource = customObjects;
        this.WebDataGrid1.DataBind();
    }

public class CustomObject
{
    public int ID { get; set; }
    public string Col1 { get; set; }

    public string Col2 { get; set; }

    public string Col3 { get; set; }

    public string Col4 { get; set; }
}

<ig:WebDataGrid ID="WebDataGrid1" runat="server" Height="244px" Width="1030px" DataKeyFields="ID">
    <behaviors>
        <ig:Filtering FilterType="ExcelStyleFilter">
        </ig:Filtering>
    </behaviors>

</ig:WebDataGrid>
billsecond
  • 612
  • 3
  • 21
  • 50
  • 1
    Did you ask Infragistics on their forums and what version of the NetAdvantage toolset do you see the error with? Have you tried the latest service release yet? – alhalama Oct 25 '13 at 22:19
  • Could it help? http://www.infragistics.com/community/forums/t/66101.aspx – Vitali K Nov 02 '13 at 13:09

0 Answers0