서버 측의 체크 박스 목록을 정렬하려면, 먼저 체크 박스 목록에 DTB에서 항목을 추가하고 true로 선택한 값을 설정할 수 있습니다 그런 다음 다른 양식을 DTA 양식에 추가하고 DTA의 각 항목에 대해 항목 목록에 없는지 확인하십시오.
두 개의 목록을 삽입 할 때 필요한 경우 보조 정렬 기준에 따라 정렬되는지 확인하십시오.
서버 측에서 정렬 작업을 수행 할 필요가 없다면 jquery를 사용하여 쉽게 처리 할 수 있습니다.
서버에서 check_box_list_client_id
을 가져와야 할 경우
$('#<%= CheckBoxList1.ClientID %>')
jquery selector를 사용하면됩니다.
$(function() {
// get the containing element - should be an HTML table
var cbl = $('#check_box_list_client_id');
// check if the jquery element has any items in it
if (cbl.length) {
// get all the table rows, and filter out all those which
// doesn't contain a checked checkbox
var cbElements = cbl.find('TR').filter(function(index, element) {
return $(this).find('input:checked').length;
});
// take each table row containing a checked checkbox and place it
// at the top of your check-box-list element we called cbl
cbElements.each(function() {
$(this).prependTo(cbl);
});
}
});
그게 네가 필요로하는 곳이면 좋겠다.