How to bind List<class> object to gridview
<p>below is my code</p>

<pre><code>    List&lt;test&gt; Students = new List&lt;test&gt;(){
    new test() { name = "Jack", imgpath = "15", Des = "100" },
    new test() { name = "Smith", imgpath = "15", Des = "101" },       
    new test() { name = "Smit", imgpath = "1", Des = "102" }
};
GridView1.DataSource = Students;
GridView1.DataBind();
</code></pre>

<p>and my class is:</p>

<pre><code>public class test
{
    public string name;
    public string imgpath;
    public string Des;  
 }
</code></pre>

<p>but it gives me error "A field or property with the name 'name' was not found on the selected data source."</p>

<p>So how to solve it. I do not know what is wrong in  my code.</p>

<p>Thanks</p>
