title: ASP.Net - Gridview row selection and effects
body: <p>I'm using the following code in attempt to allow the user to select a gridview row by clicking anywhere on the row (plus mouse over and out) effects. The code doesn't seem to be applied on rowdatabound and I can't break into the event. (It is wired).</p>
  
  <p>The control is in a usercontrol, that lives in a content page, which has a masterpage. </p>
  
  <hr>
  
  <pre><code>    protected void gvOrderTypes_RowDataBound(object sender, GridViewRowEventArgs e)
      {
          GridView gvOrdTypes = (GridView)sender;
  
          //check the item being bound is actually a DataRow, if it is,   
          //wire up the required html events and attach the relevant JavaScripts
          if (e.Row.RowType == DataControlRowType.DataRow)
          {
              e.Row.Attributes["onmouseover"] = "javascript:setMouseOverColor(this);";
              e.Row.Attributes["onmouseout"] =  "javascript:setMouseOutColor(this);";
              e.Row.Attributes["onclick"] = Page.ClientScript.GetPostBackClientHyperlink(gvOrdTypes, "Select$" + e.Row.RowIndex);
          }
      }
  </code></pre>
  
  <hr>