title: GridView from CodeBehind select row and postback
body: <p>I am having to create a <code>GridView</code> 100% in C# CodeBehind.  I have it selecting a row and posting back using this code:</p>
  
  <pre><code>    void dataGrid_ItemCreated(object sender, DataGridItemEventArgs e)
      {
          if (e.Item.ItemType == ListItemType.AlternatingItem ||
              e.Item.ItemType == ListItemType.Item)
          {
              e.Item.Attributes.Add("onmouseover",
                     "this.style.backgroundColor='beige';this.style.cursor='pointer'");
              e.Item.Attributes.Add("onmouseout",
                     "this.style.backgroundColor='#FFFFFF';");
              e.Item.Attributes.Add("onclick", "javascript:__doPostBack" +
                     "('_ctl0$DataGrid1$_ctl" +
                     ((Convert.ToInt32(e.Item.ItemIndex.ToString())) + 2) +
                     "$_ctl0','')");
          }
      }
  </code></pre>
  
  <p>This does post back but then how do I get the ID of the row the user clicked on?</p>