You can do this with custom JavaScript verification. Click the "Advanced..." button in your grid's settings, go to "Custom JavaScript Verification," and check the checkbox. This is the verification you'll want to use:
var rows = 4;
var ranks = [];
for (var row = 1; row <= rows; row++) {
var rank = SSI_GetValue('GridQ_r' + row);
if (ranks.indexOf(rank) != -1) {
strErrorMessage = 'Ranks must be unique.';
}
ranks.push(rank);
}
"GridQ" should be replaced with the grid question's name. Line 1 should be updated with the number of rows in the grid question. Line 6 can be updated to change the error message you want displayed in this situation.