problem with binding expression for gridview 
<p>Suppose I have the below class</p>

<pre><code>public partial class invoice
{
 public list&lt;lineitem&gt; lineitem;
}

public partial class lineitem
{
  private Quantity quantity = new Quantity();
        public Quantity Quantity
        {
            get { return quantity; }
            set { quantity = value; }

        }
}
</code></pre>

<p>How do I bind the value to the gridview.</p>

<pre><code>public void lbluom_OnDataBinding(object sender, System.EventArgs e)
{
            for (int i = 0; i &lt; invoicetransmit.Invoice.Count; i++)
            {
                Label lbl = (Label)sender;
                lbl.Text = 
                invoicetransmit.Invoice[0].LineItem[i].Quantity.Value.ToString();
            }
</code></pre>

<p>If I do this the values in the gridview are being overwritten with the latest values...and this one below</p>

<pre><code>public void lbluom_OnDataBinding(object sender, System.EventArgs e)
        {
            for (int i = 0; i &lt; invoicetransmit.Invoice.Count; i++)
            {
                Label lbl = (Label)sender;
                lbl.Text = Eval("Value")                
            } property does not exist.
        }
    }
</code></pre>

<p>This is how i added values to the grid</p>

<pre><code> public void Addtogrid()
    {
        //var lineItems = (Session["BillXML"] as InvoiceTransmission).Invoice[0].LineItem;
        invoicetransmit.Invoice[0].LineItem.Add(new LineItem {MaterialCode = MaterialCode.Text, ChargeCode = ChargeCode.Text, CostCenter = CostCenter.Text, GLAccount = GLAccount.Text });

        //lineItems.Add(new LineItem { MaterialCode=MaterialCode.Text,ChargeCode=ChargeCode.Text,CostCenter=CostCenter.Text,GLAccount=GLAccount.Text});
       for (int i = 0; i &lt; invoicetransmit.Invoice[0].LineItem.Count; i++)
        {
            invoicetransmit.Invoice[0].LineItem[i].Quantity.UOMCode = UOM.Text;
            invoicetransmit.Invoice[0].LineItem[i].Quantity.Value = Convert.ToDecimal(Quantity.Text);
            invoicetransmit.Invoice[0].LineItem[i].UnitPrice.Value = Convert.ToDecimal(Price.Text);
            //invoicetransmit.Invoice[0].LineItem[i].TotalNetAmount = (invoicetransmit.Invoice[0].LineItem[i].Quantity.Value) * (invoicetransmit.Invoice[0].LineItem[i].UnitPrice.Value);
            invoicetransmit.Invoice[0].LineItem[i].TotalNetAmount = ( Convert.ToDecimal(Quantity.Text) )* (Convert.ToDecimal(Price.Text));
            GridView1.DataSource = invoicetransmit.Invoice[0].LineItem;
            // GridView1.DataSource = lineItems;
            GridView1.DataBind();
            //}
</code></pre>

<p>Please help me resolve this question</p>
