
function OnGridSelectionChanged(Type) {
    if (Type == 1) {
        gvUnAssignedVehicles.GetSelectedFieldValues('VehicleId', OnGridSelectionCompleteUnAssVeh);
    }
    if (Type == 2) {
        gvAssignedVehicles.GetSelectedFieldValues('VehicleId', OnGridSelectionCompleteAssVeh);
    }
}

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

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