var Alert_SelectStudentToAssign = "Select the Student(s) to be assigned.";
var Alert_SelectStudentToUnAssign = "Select Student(s) to be unassigned.";
var Alert_noPriviledgeToAssignAdmin = "You have no privilege to assign the Administrator.";
function OnGridSelectionChangedStudentAssign(Type) {
    if (Type == 1) {
        gvUnAssignedStudents.GetSelectedFieldValues('StudentMasterID', OnGridSelectionCompleteUnAssStudent);
    }
    if (Type == 2) {
        gvAssignedStudents.GetSelectedFieldValues('StudentMasterID', OnGridSelectionCompleteAssStudent);
    }
}

function OnGridSelectionCompleteUnAssStudent(values) {
    var counter = document.getElementById("hdnStudentsToBeAssigned");
    counter.value = '';
    for (var i = 0; i < values.length; i++) {
        counter.value = counter.value + values[i] + ',';
    }
}

function OnGridSelectionCompleteAssStudent(values) {
    var counter = document.getElementById("hdnStudentsToBeUnassinged");
    counter.value = '';
    for (var i = 0; i < values.length; i++) {
        counter.value = counter.value + values[i] + ',';
    }
}
function SetAlertMessageStudentsAssignmentValidation(SelectUserToAssign, SelectuserToUnAssign) {
    Alert_SelectStudentToAssign = SelectUserToAssign;
    Alert_SelectStudentToUnAssign = SelectuserToUnAssign;    
}
function StudentAssignmentValidation(Type, hiddenFieldName) {
    var hiddenField = document.getElementById(hiddenFieldName);
    var arrHiddenField = hiddenField.value.split(",");    
    //var gridControlName = 
    var alertMessage = '';
    var isError = false;

    alertMessage = (Type == "Assign") ? Alert_SelectStudentToAssign : Alert_SelectStudentToUnAssign;

    if (arrHiddenField.length == 0 || arrHiddenField[0] == "") {
        TrinetraCustomAlerts(alertMessage);
        return false;
    }
}