Symptoms
Suppose you are trying to use Tree Control with stored procedure as its data source. K2 documentation does not say anything about support or limitations for using stored procedures as a source for Tree Control. Results you are getting when using stored procedure as a source for tree control do not look as expected/normal behavior: it displays top parent node properly but when it expanded, it displays all records as this node children, if any of these children expanded, again all records are displayed as its children and so on indefinitely.
Tree Control was configured according to instructions in respective section of K2 documentation.
Diagnoses
The reason of above described results is because the stored procedure used by customer executes a LIST method with no input properties thus it will return everything. This stored procedure needs to be adjusted to get proper results.
Resolution
In order to get desired results stored procedure has to be changed so that it will take a ParentID as input and this can be used as an input property on the TreeView’s Data Source.