Remove selection in dojo grid

Dear all,

With dojo 1.4.1 version, I am using dojo enhanced grid with Indirection
selection check box. But when I am removing a record from the grid data
store for selected records, it is removed successful but it mark the
next record selected in the grid. So what i figure out that I need to
deselect all the selected record.

function ClearGrid(grid){

if (grid.store != null){

   alert(grid.selection.setSelected);

   var items = grid.selection.getSelected();

   if (items.length>0) {

    dojo.forEach(items, function(selectedItem) {

        alert(items);

        grid.selection.setSelected(selectedItem,false);

    }); // end forEach

   }alert("Finish");

}else{

    grid.setStore(null);

    return;
}

}

But above code does not give the desired result…

Please help me

Regards

G P Reddy