On Expanding the tree the first row goes and places itself r

On Expanding the tree the first row goes and places itself right at the last row of the grid . If i repeat the behaviour then it becomes all right . But when i expand for the thrd time again problem occurs

It is not clear from you question - but if you mean dhtmlxTreeGrid component - the similar problem can occurs if you have treeGrid sorted by tree column, while all items in tree column has same labels
If you situation similar to described - please contact us at dhtmlx@scand.com and provide your customer number - I will send you an updated version, where problem solved.