if (dgTest.Rows.Count <0){int i=0;foreach(DataGridItem dgItem in dgTest.Items) { if(((HtmlInputCheckBox) dg.FindControl("chkItem")).Checked==true) //chkItem is the ID of the Checkbox in Item Template { i = i + 1; } }if (i<0){ // atleast one row is selected}else{ // no row is selected}}else{ // No rows to select}