When beginning to edit a row, retrieve the column editors and set the validation rules on them. The code below shows how to make the 'col1' required when col2 starts with 'x' char.
$('#dg').datagrid({
onBeginEdit: function(index, row){
var ed1 = $(this).datagrid('getEditor', {index:index,field:'col1'});
if (row.col2.startsWith('x')){
$(ed1.target).textbox({required:true});
}
}
})