I create gridview and remove the select button to make all row clickable but I want to redirect the user for selected item detail
Note: I remover the CommandField select Visible="False"\[code\] int rowCount = 0;protected void gv_TasksProjectForUser_RowCreated(object sender, GridViewRowEventArgs e){ if (e.Row.RowType == DataControlRowType.DataRow) { //var taskID = gv_TasksProjectForUser.SelectedDataKey.Value; e.Row.Attributes.Add("onclick", "location='TaskDetail.aspx?taskID=" + e.Row.RowIndex + "'"); e.Row.Attributes.Add("onmouseover", "JavaScript:this.style.cursor='pointer';"); } rowCount++;}\[/code\]
Note: I remover the CommandField select Visible="False"\[code\] int rowCount = 0;protected void gv_TasksProjectForUser_RowCreated(object sender, GridViewRowEventArgs e){ if (e.Row.RowType == DataControlRowType.DataRow) { //var taskID = gv_TasksProjectForUser.SelectedDataKey.Value; e.Row.Attributes.Add("onclick", "location='TaskDetail.aspx?taskID=" + e.Row.RowIndex + "'"); e.Row.Attributes.Add("onmouseover", "JavaScript:this.style.cursor='pointer';"); } rowCount++;}\[/code\]