title: Getting the index of a row in Asp.net Gridview
body: <p>i have used this code.and it shows an error:
  Dim row As GridViewRow = CType(CType(e.CommandSource, Control).NamingContainer, GridViewRow)</p>
  
  <p>The error is as folows:</p>
  
  <p>An exception of type 'System.InvalidCastException' occurred in FFK.DLL but was not handled in user code</p>
  
  <p>Additional information: Unable to cast object of type 'System.Web.UI.WebControls.ContentPlaceHolder' to type 'System.Web.UI.WebControls.GridViewRow'.</p>