i think you mean, that you want to use the MiscOptions.toGridExtensions which makes it behave more like a grid, rather than a tree. There is a demo for this.<br><br><div class="gmail_quote">On Nov 12, 2007 4:42 PM, Ross Levis <
<a href="mailto:ross@stationplaylist.com">ross@stationplaylist.com</a>> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div link="blue" vlink="purple" lang="EN-NZ">
<div>
<p><span style="color: rgb(31, 73, 125);">Thanks for that. I think I
get it now. If I define 5 columns in the Columns property then the
component will call the OnGetText event 5 times for each line (node).</span></p>
<p><span style="color: rgb(31, 73, 125);"> </span></p>
<p><span style="color: rgb(31, 73, 125);">I just have to work out what </span><span style="font-size: 11pt; color: black;">NodeData := Sender.GetNodeData(Node)</span><span style="color: rgb(31, 73, 125);"> does but there are examples for this so I should be
right, thanks.</span></p>
<p><span style="color: rgb(31, 73, 125);"> </span></p>
<p><span style="color: rgb(31, 73, 125);">Ross.</span></p>
<p><span style="color: rgb(31, 73, 125);"> </span></p>
<div>
<div style="border-style: solid none none; border-color: rgb(181, 196, 223) -moz-use-text-color -moz-use-text-color; border-width: 1pt medium medium; padding: 3pt 0cm 0cm;">
<p><b><span style="font-size: 10pt;" lang="EN-US">From:</span></b><span style="font-size: 10pt;" lang="EN-US"> <a href="mailto:delphi-bounces@delphi.org.nz" target="_blank">delphi-bounces@delphi.org.nz</a>
[mailto:<a href="mailto:delphi-bounces@delphi.org.nz" target="_blank">delphi-bounces@delphi.org.nz</a>] <b>On Behalf Of </b>Conor Boyd<br>
<b>Sent:</b> Monday, 12 November 2007 4:06 p.m.<br>
<b>To:</b> NZ Borland Developers Group - Delphi List<br>
<b>Subject:</b> RE: [DUG] Soft-Gems Virtual TreeView for a ListView</span></p>
</div>
</div><div><div></div><div class="Wj3C7c">
<p> </p>
<p><span style="font-size: 10pt; color: blue;">The Header property of TVirtualStringTree has a Columns
property. Specify your columns in there.</span><span></span></p>
<p><span> </span></p>
<p><span style="font-size: 10pt; color: blue;">Then the OnGetText event has a Column parameter.</span><span></span></p>
<p><span> </span></p>
<p><span style="font-size: 10pt; color: blue;">So you can do something like this in your OnGetText event handler:</span><span></span></p>
<p><span> </span></p>
<p><span style="font-size: 10pt; color: blue;">procedure TFileSelectionDialog.vstFilesGetText(Sender:
TBaseVirtualTree; Node: PVirtualNode; Column: TColumnIndex; TextType:
TVSTTextType;<br>
var CellText: WideString);<br>
var<br>
NodeData : PTreeViewNodeData;<br>
begin<br>
NodeData := Sender.GetNodeData(Node);</span><span></span></p>
<div>
<p><span> </span></p>
</div>
<p><span style="font-size: 10pt; color: blue;"> CellText := '';</span><span></span></p>
<div>
<p><span> </span></p>
</div>
<p><span style="font-size: 10pt; color: blue;"> case Column of<br>
0: CellText := ExtractFileName(NodeData.Filename);<br>
1: begin<br>
if not NodeData.IsFolder
then<br>
CellText :=
DateTimeToStr(NodeData.FileDate);<br>
end;<br>
end;<br>
end;</span><span></span></p>
<div>
<p><span style="font-size: 10pt; color: blue;">This is from when I wrote our own file selection dialog, since the built-in Delphi one can't cope with more than a certain number of files</span><span></span></p>
</div>
<div>
<p><span style="font-size: 10pt; color: blue;">(if you're interested in the specifics, IIRC
the number of files the built-in
one can cope with is limited to the number of fully qualified
paths which will fit into 32000 bytes or something - it's a problem with
the underlying WinAPI).</span><span></span></p>
</div>
<div>
<p><span> </span></p>
</div>
<div>
<p><span style="font-size: 10pt; color: blue;">Hopefully that's enough to get you going. Ask away if you've
got more questions.</span><span></span></p>
</div>
<div>
<p><span> </span></p>
</div>
<div>
<p><span style="font-size: 10pt; color: blue;">HTH,</span><span></span></p>
</div>
<div>
<p><span> </span></p>
</div>
<div>
<p><span style="font-size: 10pt; color: blue;">Conor</span><span></span></p>
</div>
<div>
<p><span> </span></p>
</div>
<div style="text-align: center;" align="center"><span lang="EN-US">
<hr align="center" size="3" width="100%">
</span></div>
<p><b><span style="font-size: 10pt;" lang="EN-US">From:</span></b><span style="font-size: 10pt;" lang="EN-US"> <a href="mailto:delphi-bounces@delphi.org.nz" target="_blank">delphi-bounces@delphi.org.nz</a>
[mailto:<a href="mailto:delphi-bounces@delphi.org.nz" target="_blank">delphi-bounces@delphi.org.nz</a>] <b>On Behalf Of </b>Ross Levis<br>
</span><span style="font-size: 10pt; color: blue;" lang="EN-US"> </span><span lang="EN-US"></span></p>
<p><span lang="EN-US">I
think someone mention they were using Virtual TreeView recently. I heard
that it can be made to look like a standard ListView, so I'm
investigating it to replace a TListView in an app of mine which takes far too
long to load up to 20,000 items.</span></p>
<p> </p>
<p>I can't use TListView in virtual mode as it seems way
too difficult to enable sorting on columns which I need. The Virtual
TreeView appears to handle sorting as easy as TListView does in non-virtual
mode.</p>
<p> </p>
<p>I'm just having difficultly working out how the use
the component! I realize I need to set up a record for each set of data
but I can't work out how to add columns of data. The examples are
mostly involved with tree structures.</p>
<p> </p>
<p>I'm hoping someone can quote for me a basic piece of
code for adding say 2 items with 2 or 3 columns.</p>
</div></div></div>
</div>
<br>_______________________________________________<br>NZ Borland Developers Group - Delphi mailing list<br>Post: <a href="mailto:delphi@delphi.org.nz">delphi@delphi.org.nz</a><br>Admin: <a href="http://delphi.org.nz/mailman/listinfo/delphi" target="_blank">
http://delphi.org.nz/mailman/listinfo/delphi</a><br>Unsubscribe: send an email to <a href="mailto:delphi-request@delphi.org.nz">delphi-request@delphi.org.nz</a> with Subject: unsubscribe<br></blockquote></div><br><br clear="all">
<br>-- <br>Kyley Harris<br>Harris Software<br>+64-21-671-821