title: use a imageButton in GridView to select the row
body: <p>I am trying to use a image button in a grid view to select a row so that i can then use the SelectedIndexChanged function to do other things. i have tried this:</p>
  
  <pre><code>    &lt;asp:ImageButton ID="Image1" CommandName="SelectRowGrid2" runat="server" ImageUrl="~/images/select.png" /&gt;
  
    Protected Sub GridView2_RowCommand(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewCommandEventArgs) Handles GridView2.RowCommand
          Select Case e.CommandName
              Case "SelectRowGrid2"
                  'some code for selecting the index?
                  Label1.Text = GridView2.SelectedIndex
          End Select
      End Sub
  </code></pre>
  
  <p>but it didn't even step in to the RowCommand sub when i went to debug it.
  thanks in advanced.</p>