I use this code for gridview:
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{ if (e.Row.RowType == DataControlRowType.DataRow)
{
e.Row.Attributes.Add("style", "font-weight:bold;color:blue");
e.Row.Attributes.Add("style", "cursor:pointer;");
e.Row.Attributes.Add("onclick", "location='WebForm1.aspx?id=" + DataBinder.Eval(e.Row.DataItem, "CustomerID") + "'";);
}}
also use TemplateField to add a column of checkbox. my problem is when I click on any field of row goto WebForm1.aspx but I want when click on CheckBox no goto WebForm1.aspx page and only check CheckBox Control.