get cell value after clearandload

how do i get a cell value after a call as such:

var qty;
grid.clearAndLoad(data);
qty = grid.cells(0,5).getValue();

I want to get the value of the cell 5 from the first row. basically have a grid with 1 row and 7 columns. i always get qty is undefined.

Pleas,e try to use the callback function:
grid.clearAndLoad(data,function(){
qty = grid.cells(0,5).getValue();
});

no luck so how do i get the value of a grid cell? i have a grid that is load and the user can edit inline within the grid. i simply want to get the value of the cell when the user clicks a button.

var qty = grid.cells(0, 5).getValue();

throws an error:

Uncaught TypeError: Cannot read property ‘_childIndexes’ of null in the dhtmlx.js:9

Pleas,e make sure that the requested call is in your grid.
NOTE: it is not available to have the row id = “0”, which is in your cells() method.