SharePoint サイトで動的列のみを使用して Infragistics WebDataGrid を使用すると、エラーが発生します。
エラー: [HttpException]: コントロールにコード ブロック (つまり <% ... %>) が含まれているため、コントロール コレクションを変更できません。
助けていただけますか?
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>