Hello Igor,
Thank you for the code example, you have provided.You can use, setting the XamTreeGrid's ActiveRecord. When you set it programmatically the XamTreeGrid will scroll to it and will mark it in blue color.Like in your example XamGrid.ActiveRecord = rec. And after that you can mark it as selected.
To illustrate this I have prepared a sample application, please test it with writing Id's which are out of view or are not expanded.