EhLib.Com
https://forum.ehlib.com/en/

Tree View control the father node to stop expand
https://forum.ehlib.com/en/viewtopic.php?f=5&t=1296
Page 1 of 1

Author:  ituneksa [ 02 Nov 2024, 18:05 ]
Post subject:  Tree View control the father node to stop expand

Hi
Pls see the attached file.
In tree View It is possible to control the father node (circle red color) to stop expand the children node .

Best Regards

Attachments:
ehlib.jpg
ehlib.jpg [ 55.16 KiB | Viewed 3796 times ]

Author:  EhLibSupport [ 04 Nov 2024, 10:15 ]
Post subject:  Re: Tree View control the father node to stop expand

Hello

If you want to prevent a branch from opening when the user clicks the Plus sign, you can use the TMemTableEh.OnRecordsViewTreeNodeExpanding event as follows:

Code:
procedure TForm1.MemTableEh1RecordsViewTreeNodeExpanding(Sender: TObject;
  Node: TMemRecViewEh; var AllowExpansion: Boolean);
begin
  if (Node.Rec.DataValues['ID', TDataValueVersionEh.dvvValueEh] = 3) then
    AllowExpansion := False;
end;


ID is a field in the TMemTableEh table.

Page 1 of 1 All times are UTC
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/