Check the current Row is a data row or not
<p>I have a gridview with 10 rows i am displaying 6 rows in each page i have a text box and and image button in each row when i click the image button all the functionalities are working but when i click the page index it is displaying an error in row command how can i check whether the row type is data row or not in gridview row command event. the code that i am using is as follows</p>

<pre><code>protected void gvgridview1_RowCommand(object sender, GridViewCommandEventArgs e)
    {
      GridViewRow gvRow = (GridViewRow)(((ImageButton)e.CommandSource).NamingContainer);
      TextBox txtgvGroupName = (TextBox)gvRow.FindControl("txtgvGroupName");
      ImageButton imgbtn = (ImageButton)gvRow.FindControl("imgbtn");
      if (e.CommandName == "Edit")
            {
              imgbtn.Visible = false;
            }
    }
</code></pre>
