Hi
Just change your code with
<asp:GridView ID="dgv1" runat="Server" AutoGenerateColumns="false"
CssClass="mGrid" Height="50px" Width="20px" OnSelectedIndexChanged="dgv1_SelectedIndexChanged" >
<Columns>
<asp:CommandField ShowSelectButton = "True" />
</Columns>
<SelectedRowStyle BackColor = "#FFCC66" Font-Bold = "True" ForeColor = "#663399" />
</asp:GridView>
//in code behind
protected void dgv1_SelectedIndexChanged(object sender, EventArgs e)
{
//You code
}