감사합니다 안톤,하지만 난 자바 스크립트로 해냈어. 나는 다음과 같이 테이블의 짝수와 틀린 편을 사용하고있다. 여기는 document.ready 함수를 호출하는 함수입니다. 또한 각 버튼의 click 이벤트를 서버 측에서 호출합니다.
colorGrid 함수() {
/*code for color coding grid*/
$(".student_account td table tbody tr'[id]':odd").addClass('initial');
$(".student_account td table tbody tr'[id]':even").addClass('initial');
/* For odd Rows */
// for first 3 columns
$(".student_account td table tbody tr'[id]':odd td:nth-child(1)").css("background-color", "#EEEEEE");
$(".student_account td table tbody tr'[id]':odd td:nth-child(2)").css("background-color", "#EEEEEE");
$(".student_account td table tbody tr'[id]':odd td:nth-child(3)").css("background-color", "#EEEEEE");
// for 4th and 5th column
$(".student_account td table tbody tr'[id]':odd td:nth-child(4)").css("background-color", "#EBFAE3");
$(".student_account td table tbody tr'[id]':odd td:nth-child(5)").css("background-color", "#EBFAE3");
// for 6th t0 9th column
$(".student_account td table tbody tr'[id]':odd td:nth-child(6)").css("background-color", "#F7F8D6");
$(".student_account td table tbody tr'[id]':odd td:nth-child(7)").css("background-color", "#F7F8D6");
$(".student_account td table tbody tr'[id]':odd td:nth-child(8)").css("background-color", "#F7F8D6");
$(".student_account td table tbody tr'[id]':odd td:nth-child(9)").css("background-color", "#F7F8D6");
// for 10th column
$(".student_account td table tbody tr'[id]':odd td:nth-child(10)").css("background-color", "#CBE6F7");
/* For Even Rows */
var name = "ctl00_ContentPlaceHolder1_grdScheduleStudent_DXHeadersRow";
// for first 3 columns
$(".student_account td table tbody tr'[id]':even td:nth-child(1)").css("background-color", "#FFFFFF");
$(".student_account td table tbody tr'[id]':even td:nth-child(2)").css("background-color", "#FFFFFF");
$(".student_account td table tbody tr'[id]':even td:nth-child(3)").css("background-color", "#FFFFFF");
// for 4th and 5th column
$(".student_account td table tbody tr'[id]':even td:nth-child(4)").css("background-color", "#F5FAF3");
$(".student_account td table tbody tr'[id]':even td:nth-child(5)").css("background-color", "#F5FAF3");
// for 6th t0 9th column
$(".student_account td table tbody tr'[id]':even td:nth-child(6)").css("background-color", "#FBFCEA");
$(".student_account td table tbody tr'[id]':even td:nth-child(7)").css("background-color", "#FBFCEA");
$(".student_account td table tbody tr'[id]':even td:nth-child(8)").css("background-color", "#FBFCEA");
$(".student_account td table tbody tr'[id]':even td:nth-child(9)").css("background-color", "#FBFCEA");
// for 10th column
$(".student_account td table tbody tr'[id]':even td:nth-child(10)").css("background-color", "#EDF8FE");
$(".student_account td table tbody tr'[id=" + name + "]' td").css("background-color", "#56A52E");
/*end color coding*/
}
확인이 : http://stackoverflow.com/questions/13487354/how-to-change-the-datagrid-back-ground-color/13487550#13487550 – Nag
이것은 단순한 gridview에 관한 것입니다. 나는 익스프레스 devp의 aspx gridview 있습니다. –