Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I think your confusion is thinking of storing Visual Forms and components including their data. I believe you can do this with the the streaming system - although I never have! I like to keep the data and the visuals as separate as possible.</p> <p>So you need a custom list to put in MyData that contains all the data and settings that need to go in the listview something like MyDataList: (I'm typing this straight in!)</p> <pre><code>type TMyDataViewData = class(TPersistent) Caption: string; ImageIndex: Integer; StateIndex: Integer; Group: Integer; MemoData: TStrings; end; TMyDataViewDataList = class(TPersistent) TheList: TObjectList; property Items[Index:Integer]:MyDataViewData read getItems write SetItems; property Count: Integer read GetCount; . . . end; TMyData = class(TComponent) private FString1: String; FString2: String; FInteger1: Integer; private MyForm: TMyEditform; published procedure Edit(Owner: TComponent); property String1: String read FString1 write FString1; property String2: String read FString2 write FString2; property Integer1: Integer read FInteger1 write FInteger1; property TheDataList: TMyDataViewDataList read fTheDataList write fTheDataList; end; procedure TMyData.Edit; var F: TMyEditForm; begin F:= TMyEditForm.create(Owner); F.DataList := TheDatalist; // data for listview and memos F.ShowModal; . . . end; </code></pre> <p>Then in your Treeview you only need to do:</p> <pre><code> If TreeNode.Data is TMyData then TMyData(TreeNode.Data).Edit(Self); </code></pre> <p>After the edit all the data for changing the treeview node info should be in MyData so you can do </p> <pre><code> Node.Text := TMyData(Node.Data).TheDataList.Items[0].Caption; </code></pre> <p>or</p> <pre><code>for i := 0 to TMyData(Node.data).TheDataList.Count do Node.AddChild(TMyData(Node.Data).TheDataList.Items[i].Caption); </code></pre> <p>You can also easily expose properties of the Datalist to TMyData directly :)</p> <p>and such like. Probably a few syntax error in there!</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload