Checkboxes in datagrids

Hi, does anyone know how to check the value of a checkbox in a datagrid? i thought it was something like:

for (i = 0; i < datagrid.length; i++){
if (datagrid.getItemAt(i).Check){
// do something.
}
}

is this not right?