title: How to get Id of a DataItem in ListView after DataBound
body: <p>i am new in ListView Control. I have a List view to show shopping products. in each data Item i put a link-button for "Add to cart" button. in my scenario clicking on this button causes <code>ShoppingCart.Instance.AddItem("Product GUID")</code> to call. how can i perform that?<br/>
  i set <code>CommandName="Select"</code> in Link Button and performed this:</p>
  
  <pre><code>protected void ListView1_SelectedIndexChanging(object sender, ListViewSelectEventArgs e)
  {
      ListViewItem item = (ListViewItem)ListView1.Items[e.NewSelectedIndex];
      LinkButton lb = (LinkButton)item.FindControl("LinkButtonAddAndClose");
  // Here i want to get selected Product Id...
  }
  </code></pre>
  
  <p>but always the selectedIndex is Zero!!!
  How can I call <code>ShoppingCart.Instance.AddItem("Product GUID")</code> and get Product Id from DataItem???<br/>
  note: <code>Eval("ID")</code> gets Product GUID.</p>
  
  <p><strong>Update:</strong><br/>
  I Set <code>&lt;%# Eval("ID")%&gt;</code> for CommandArgument of LinkButton and i want somthing linke this:
  <br/></p>
  
  <pre><code>protected void LinkButtonAddAndClose_Click(object sender, EventArgs e)
  {
      LinkButton lb = (LinkButton)sender;
  
      var productId = new Guid(lb.CommandArgument);
  
      ShoppingCart.Instance.AddItem(productId);
  }
  </code></pre>