How to add sub rows on cellchaged event of the treegrid

mygrid.attachEvent(“onCellChanged”, function(rId,cInd,nValue)
{
if(cInd == 18)
{
var occurenceLen = occurrences(rId,"_");
if(occurenceLen == 1)
{
// addRow(rId);
}

}
});

But oncell changed events called for the newly added rows, so it adds new rows to some other rows.Please help to solve this issue.

Please, try to use the onEditCell event.
Also you may try to attach the onCellChanged event after the data is loaded to the grid.