title: highlight selected row in gridview without postback
body: <p>I hav a gridview in asp.net which updates a preview picture whenever it is clicked. this works without a postback and I do it this way:</p>
  
  <pre><code>protected void GridView1_RowCreated(object sender,System.Web.UI.WebControls.GridViewRowEventArgs e)
     {
     if (e.Row.RowType == DataControlRowType.DataRow)
       {
        e.Row.Attributes["onmouseover"] = "this.style.cursor='pointer';this.style.textDecoration='underline';";
        e.Row.Attributes["onmouseout"] = "this.style.textDecoration='none';";
        e.Row.ToolTip = "Click to select row";
        e.Row.Attributes["onclick"] = "RetrievePicture(" + GVmail.DataKeys[e.Row.RowIndex].Value.ToString() + ",this)";
       }
    }
  </code></pre>
  
  <p>However, I want the user to be able to see which row is selected and therefore displaying the image.. (so I want to row to stay highlighted). and then when another row is selected, i want that row to go back to normal and the newly selected one to be highlighted.</p>
  
  <p>how can I do this without a postback?</p>