Aug 01, 2012, 11:54 AM
fill my store from a list of object.
Hi all
I am a beginner in Ext.NET
I wanted to do a simple example:
Thi
I am a beginner in Ext.NET
I wanted to do a simple example:
<ext:Store runat="server" ID="strPeople">
<Model>
<ext:Model ID="Model" runat="server" IDProperty="PersonID">
<Fields>
<ext:ModelField Name="PersonID" />
<ext:ModelField Name="FirstName" />
<ext:ModelField Name="LastName" />
</Fields>
</ext:Model>
</Model>
</ext:Store>
protected void Page_Load(object sender, EventArgs e)
{
if (!X.IsAjaxRequest)
{
List<Person> opPeople = new List<Person>
{
new Person { PersonID = 1, FirstName = "Scarlett", LastName = "Johansson"},
new Person { PersonID = 2, FirstName = "Natalie", LastName = "Portman"},
new Person { PersonID = 3, FirstName = "Angelina", LastName = "Jolie"}
};
strPeople.DataSource = opPeople;
strPeople.DataBind();
//strPeople.Model.Add(opPeople);
}
}
private class Person
{
public int PersonID { get; set; }
public string FirstName { get; set; }
public string LastName { get; set; }
}
strPeople is null ! how I have my code corrriger ? Thi