Also you have mentioned that you don’t get any script error. We suspect that you may not have data with level 2, and due to that, when you call collapseAtLevel method with “2” as parameter, it does nothing. Please make sure that the data you have binded to treegrid have level 2 if you call collapseAtLevel method with “2” as parameter.
Still facing the issue, please share us the below details,
Complete treegrid rendering code
If possible, reproduce the issue in the sample above and share us.
If you have further queries, please get back to us.