SQL in a TreeGridView

I want to display the results obtained by SQL in a TreeGridView, but I want to implement it.
QueryBuilder does not allow me to achieve this.
Can I display TGV trees?
I want to narrow down my search by conditional branching.