Article View: borland.public.delphi.xml
Article #173Re: XML & TreeView
From: Ronald Hoek
Date: Tue, 20 May 2008 11:20
Date: Tue, 20 May 2008 11:20
44 lines
1742 bytes
1742 bytes
Hello Guthrie,
I'm suspecting you want to do something like the following:
procedure TMyForm.LoadTreeview(const aXML: string);
var
I: Integer;
tn: TTreeNode;
begin
FContacts := LoadContactFromXML(aXML);
tv.Items.BeginUpdate;
try
tv.Items.Clear;
for I := 0 to Contacts.Count - 1 do
begin
tn := tv.Items.Add(nil, Contacts[I].Name);
tn.Data := Pointer(Contacts[I]);
end;
finally
tv.Items.BeginUpdate;
end;
end;
procedure TMyForm.OntvChange(Sender: TObject);
var
_Cont: IXMLContact;
begin
_Cont := IXMLContact((Sender as TTreeView).Selected.Data);
// Fill edits at this point
end;
Use the XML-databinding tool, to create a Pascal binding for the XML
--
Regards,
Ronald Hoek
Applicationdevelopper
ComponentAgro B.V.
Technical Details
Message-ID:
<4832b404$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!feeder3.cambrium.nl!feeder6.cambrium.nl!feeder2.cambrium.nl!feed.tweaknews.nl!193.201.147.85.MISMATCH!feed.xsnews.nl!border-2.ams.xsnews.nl!news.isoc.lu!newsgroups.borland.com!not-for-mailReferences:
<482f399b@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: f5d9b,a02bdc3255930b71 X-Google-Attributes: gidf5d9b,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit From: "Ronald Hoek" <none> Newsgroups: borland.public.delphi.xml References: <482f399b@newsgroups.borland.com> Subject: Re: XML & TreeView Date: Tue, 20 May 2008 13:20:36 +0200 Lines: 47 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.5512 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5512 X-RFC2646: Format=Flowed; Response NNTP-Posting-Host: 82.92.49.221 Message-ID: <4832b404$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1211282436 82.92.49.221 (20 May 2008 04:20:36 -0700) Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!feeder3.cambrium.nl!feeder6.cambrium.nl!feeder2.cambrium.nl!feed.tweaknews.nl!193.201.147.85.MISMATCH!feed.xsnews.nl!border-2.ams.xsnews.nl!news.isoc.lu!newsgroups.borland.com!not-for-mail