<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML xmlns="http://www.w3.org/TR/REC-html40" xmlns:v = 
"urn:schemas-microsoft-com:vml" xmlns:o = 
"urn:schemas-microsoft-com:office:office" xmlns:w = 
"urn:schemas-microsoft-com:office:word" xmlns:m = 
"http://schemas.microsoft.com/office/2004/12/omml"><HEAD>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.6000.16544" name=GENERATOR>
<STYLE>@font-face {
        font-family: Calibri;
}
@page Section1 {size: 612.0pt 792.0pt; margin: 72.0pt 72.0pt 72.0pt 72.0pt; }
P.MsoNormal {
        FONT-SIZE: 12pt; MARGIN: 0cm 0cm 0pt; FONT-FAMILY: "Calibri","sans-serif"
}
LI.MsoNormal {
        FONT-SIZE: 12pt; MARGIN: 0cm 0cm 0pt; FONT-FAMILY: "Calibri","sans-serif"
}
DIV.MsoNormal {
        FONT-SIZE: 12pt; MARGIN: 0cm 0cm 0pt; FONT-FAMILY: "Calibri","sans-serif"
}
A:link {
        COLOR: blue; TEXT-DECORATION: underline; mso-style-priority: 99
}
SPAN.MsoHyperlink {
        COLOR: blue; TEXT-DECORATION: underline; mso-style-priority: 99
}
A:visited {
        COLOR: purple; TEXT-DECORATION: underline; mso-style-priority: 99
}
SPAN.MsoHyperlinkFollowed {
        COLOR: purple; TEXT-DECORATION: underline; mso-style-priority: 99
}
SPAN.EmailStyle17 {
        COLOR: windowtext; FONT-FAMILY: "Calibri","sans-serif"; mso-style-type: personal-compose
}
.MsoChpDefault {
        mso-style-type: export-only
}
DIV.Section1 {
        page: Section1
}
</STYLE>
<!--[if gte mso 9]><xml>
 <o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
 <o:shapelayout v:ext="edit">
  <o:idmap v:ext="edit" data="1" />
 </o:shapelayout></xml><![endif]--></HEAD>
<BODY lang=EN-NZ vLink=purple link=blue>
<DIV dir=ltr align=left><SPAN class=300060103-12112007><FONT face=Arial 
color=#0000ff size=2>The Header property of TVirtualStringTree has a Columns 
property.&nbsp; Specify your columns in there.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=300060103-12112007><FONT face=Arial 
color=#0000ff size=2></FONT></SPAN>&nbsp;</DIV>
<DIV dir=ltr align=left><SPAN class=300060103-12112007><FONT face=Arial 
color=#0000ff size=2>Then the OnGetText event has a Column 
parameter.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=300060103-12112007><FONT face=Arial 
color=#0000ff size=2></FONT></SPAN>&nbsp;</DIV>
<DIV dir=ltr align=left><SPAN class=300060103-12112007><FONT face=Arial 
color=#0000ff size=2>So you can do something like this in your OnGetText event 
handler:</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=300060103-12112007><FONT face=Arial 
color=#0000ff size=2></FONT></SPAN>&nbsp;</DIV>
<DIV dir=ltr align=left><SPAN class=300060103-12112007><FONT face=Arial 
color=#0000ff size=2>procedure TFileSelectionDialog.vstFilesGetText(Sender: 
TBaseVirtualTree; Node: PVirtualNode; Column: TColumnIndex; TextType: 
TVSTTextType;<BR>&nbsp; var CellText: WideString);<BR>var<BR>&nbsp; NodeData : 
PTreeViewNodeData;<BR>begin<BR>&nbsp; NodeData := 
Sender.GetNodeData(Node);</FONT></SPAN></DIV>
<DIV><FONT face=Arial color=#0000ff size=2></FONT>&nbsp;</DIV>
<DIV dir=ltr align=left><SPAN class=300060103-12112007><FONT face=Arial 
color=#0000ff size=2>&nbsp; CellText := '';</FONT></SPAN></DIV>
<DIV><FONT face=Arial color=#0000ff size=2></FONT>&nbsp;</DIV>
<DIV dir=ltr align=left><SPAN class=300060103-12112007><FONT face=Arial 
color=#0000ff size=2>&nbsp; case Column of<BR>&nbsp;&nbsp;&nbsp; 0:&nbsp; 
CellText := ExtractFileName(NodeData.Filename);<BR>&nbsp;&nbsp;&nbsp; 1:&nbsp; 
begin<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if not 
NodeData.IsFolder 
then<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
CellText := 
DateTimeToStr(NodeData.FileDate);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
end;<BR>&nbsp; end;<BR>end;<BR></FONT></SPAN></DIV>
<DIV><SPAN class=300060103-12112007></SPAN><FONT face=Arial><FONT 
color=#0000ff><FONT size=2><SPAN class=300060103-12112007>This is from when 
</SPAN>I&nbsp;wrote&nbsp;<SPAN 
class=300060103-12112007>our</SPAN>&nbsp;own&nbsp;file&nbsp;selection&nbsp;dialog,&nbsp;since&nbsp;the&nbsp;built-<SPAN 
class=300060103-12112007>in</SPAN>&nbsp;Delphi&nbsp;one&nbsp;can't&nbsp;cope&nbsp;with&nbsp;more&nbsp;than&nbsp;a&nbsp;certain&nbsp;number&nbsp;of&nbsp;files</FONT></FONT></FONT></DIV>
<DIV><FONT face=Arial><FONT color=#0000ff><FONT 
size=2>(if&nbsp;you're&nbsp;interested&nbsp;in&nbsp;the&nbsp;specifics,&nbsp;<SPAN 
class=300060103-12112007>IIRC 
</SPAN>the&nbsp;number&nbsp;of&nbsp;files&nbsp;<SPAN 
class=300060103-12112007>the built-in 
one</SPAN>&nbsp;can&nbsp;cope&nbsp;with&nbsp;is&nbsp;limited&nbsp;to&nbsp;the&nbsp;number&nbsp;of&nbsp;fully&nbsp;qualified<SPAN 
class=300060103-12112007> paths which will fit into 32000&nbsp;bytes or 
something - it's a problem with the underlying 
WinAPI).</SPAN></FONT></FONT></FONT></DIV>
<DIV><FONT face=Arial><FONT color=#0000ff><FONT size=2><SPAN 
class=300060103-12112007></SPAN></FONT></FONT></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial><FONT color=#0000ff><FONT size=2><SPAN 
class=300060103-12112007>Hopefully that's enough to get you going.&nbsp; Ask 
away if you've got more questions.</SPAN></FONT></FONT></FONT></DIV>
<DIV><FONT face=Arial><FONT color=#0000ff><FONT size=2><SPAN 
class=300060103-12112007></SPAN></FONT></FONT></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial><FONT color=#0000ff><FONT size=2><SPAN 
class=300060103-12112007>HTH,</SPAN></FONT></FONT></FONT></DIV>
<DIV><FONT face=Arial><FONT color=#0000ff><FONT size=2><SPAN 
class=300060103-12112007></SPAN></FONT></FONT></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial><FONT color=#0000ff><FONT size=2><SPAN 
class=300060103-12112007>Conor</SPAN></FONT></FONT></FONT></DIV>
<DIV><BR></DIV>
<DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left>
<HR tabIndex=-1>
</DIV>
<DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left><FONT 
face=Tahoma><FONT size=2><B>From:</B> delphi-bounces@delphi.org.nz 
[mailto:delphi-bounces@delphi.org.nz] <B>On Behalf Of </B>Ross Levis<BR><SPAN 
class=300060103-12112007><FONT face=Arial 
color=#0000ff>&nbsp;</FONT></SPAN></FONT></FONT></DIV>
<DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left>I think someone 
mention they were using Virtual TreeView recently.&nbsp; I heard that it can be 
made to look like a standard ListView, so I&#8217;m investigating it to replace a 
TListView in an app of mine which takes far too long to load up to 20,000 
items.<o:p></o:p></DIV>
<DIV class=Section1>
<P class=MsoNormal><o:p>&nbsp;</o:p></P>
<P class=MsoNormal>I can&#8217;t use TListView in virtual mode as it seems way too 
difficult to enable sorting on columns which I need.&nbsp; The Virtual TreeView 
appears to handle sorting as easy as TListView does in non-virtual 
mode.<o:p></o:p></P>
<P class=MsoNormal><o:p>&nbsp;</o:p></P>
<P class=MsoNormal>I&#8217;m just having difficultly working out how the use the 
component!&nbsp; I realize I need to set up a record for each set of data but I 
can&#8217;t work out how to add columns of data.&nbsp; The examples are mostly 
involved with tree structures.<o:p></o:p></P>
<P class=MsoNormal><o:p>&nbsp;</o:p></P>
<P class=MsoNormal>I&#8217;m hoping someone can quote for me a basic piece of code for 
adding say 2 items with 2 or 3 columns.</P></DIV></BODY></HTML>