Components for Delphi and C++ Builder.

Go to Russian forum
Go to EhLib.com
It is currently 24 Apr 2024, 07:30

All times are UTC




Post new topic Reply to topic  [ 2 posts ] 
Author Message
PostPosted: 06 Nov 2017, 15:59 
Offline

Joined: 26 Jan 2016, 09:46
Posts: 56
Hi,

It was possible to change by programming node status ?
I would like to know if nodes are open / closed and after rebuilding my tree, put the nodes back in the same state (closed or open).

I do not know what function or property I have to use to do it.

I used DBGridEh + DataSource + MemTableEh + DataSetDriverEh + ADOQuery.

Thank you in advance,


Top
 Profile  
 
PostPosted: 09 Nov 2017, 10:01 
Offline

Joined: 08 May 2014, 18:06
Posts: 663
Hello

You can use similar code to run through all the elements of the tree:

Code:
procedure TForm1.Button4Click(Sender: TObject);
var
  i: Integer;
  RecView: TMemRecViewEh;
  s: String;
begin
  //MemTableEh1.TreeList.
  for i := 0 to MemTableEh1.RecordsView.MemoryTreeList.AccountableCount-1 do
  begin
    RecView := MemTableEh1.RecordsView.MemoryTreeList.AccountableItem[i];
    s := 'ID = ' + VarToStr(RecView.Rec.DataValues['ID', dvvValueEh]);
    s := s + ' Status = ' + BoolToStr(RecView.NodeExpanded, True);
    DBMemoEh1.Lines.Add(s);
  end;
end;


Use MemTableEh1.RecordsView.MemoryTreeList.AccountableItem property to access elements in the tree.
Use RecView.NodeExpanded property to get or set Expanded status.
Use RecView.Rec.DataValues properties to access record values.

_________________
Best regards
EhLib Support Team


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 11 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group