emin 7 Posted November 14, 2020 Share Posted November 14, 2020 When I use DBTreeGrid, I encountered two problems and although I searched the forum, I could not find a solution. 1- If I add TreeKeyFields values at design time, fields is grouped accordingly. When I change these values at runtime, there is no change. However, it is effective if I recreate the treegrid. This is not a very effective solution either. Because it is not very logical to do this every time a query runs on the data source that DBTreeGrid is connected to. 2- When I query on which DBTreeGrid is connected, it automatically becomes Fullcollapse. I tried the following methods to make the tree FullExpand again when the query changes. However, there was no change. When I do the query and FullExpand process at the same time, it is not effective. After the query, when I click the button, FullExpand works. How can I solve the problem? The code I use is: query.sql.text: = 'xxxxx'; Query.open; UniDBTreeGrid1.FullExpand; Alternatively, I used the code below. But it didn't help. UniTreeMenu1.JSInterface.JSCode (# 1'.getStore (). Data.items.forEach (function (hand) {el.expand ()}); '); Quote Link to post Share on other sites
Sherzod 1107 Posted November 14, 2020 Share Posted November 14, 2020 7 hours ago, emin said: 2- When I query on which DBTreeGrid is connected, it automatically becomes Fullcollapse. I tried the following methods to make the tree FullExpand again when the query changes. However, there was no change. When I do the query and FullExpand process at the same time, it is not effective. After the query, when I click the button, FullExpand works. procedure TMainForm.UniFormReady(Sender: TObject); begin UniDBTreeGrid1.FullExpand; end; ? Quote Link to post Share on other sites
emin 7 Posted November 14, 2020 Author Share Posted November 14, 2020 I added a video to demonstrate the problem. Quote Link to post Share on other sites
Sherzod 1107 Posted November 14, 2020 Share Posted November 14, 2020 47 minutes ago, emin said: I added a video to demonstrate the problem. function afterCreate(sender) { sender.getStore().on('load', function(){sender.expandAll()}) } Quote Link to post Share on other sites
emin 7 Posted November 15, 2020 Author Share Posted November 15, 2020 It works. Thanks a lot 1 Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.