emin 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 ()}); '); Link to comment Share on other sites More sharing options...
Sherzod 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; ? Link to comment Share on other sites More sharing options...
emin Posted November 14, 2020 Author Share Posted November 14, 2020 I added a video to demonstrate the problem. Link to comment Share on other sites More sharing options...
Sherzod 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()}) } Link to comment Share on other sites More sharing options...
emin Posted November 15, 2020 Author Share Posted November 15, 2020 It works. Thanks a lot 1 Link to comment Share on other sites More sharing options...
fraxzi Posted April 24, 2021 Share Posted April 24, 2021 Hi @Sherzod How about changing the "TreeKeyFields" at runtime? Thanks in advance, Frances Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now