Here is sample code to get sub grid cell value in MS CRM 2013.
function GetSubGridCellValues() {
if (document.getElementById("SubGridName")) {
var grid = document.getElementById("SubGridName").control;
var ids = gridControl.get_allRecordIds();
for (i = 0; i < ids.length; i++) {
alert(gridControl.getCellValue('fullname', ids[i]));
}
}
else {
setTimeout("GetSubGridCellValues();", 2500);
}
}