- This topic has 1 reply, 2 voices, and was last updated 2021-07-27 at 2:37 am by .
Viewing 1 reply thread
Viewing 1 reply thread
- You must be logged in to reply to this topic.
Home › Forums › Konopka Signature VCL Controls (formerly Raize Components) › TrzSelectFolderDialog Sort Option?
Is there a way to set the folder sort, for example to date modified?
thanks in advance, Ray !
-Monte
You can affect the sorting of the ShellTree used by the RzSelectFolderDialog component by do a little bit of a hack. For example,
uses
RzShellFolderForm;
procedure TForm13.RzButton1Click(Sender: TObject);
begin
RzSelectFolderDialog1.Execute;
end;
function CustomSortProc(Node1, Node2: TTreeNode; Data: Integer): Integer; stdcall;
begin
Result := -AnsiStrIComp(PChar(Node1.Text), PChar(Node2.Text));
end;
procedure TForm13.RzSelectFolderDialog1FormShow(Sender: TObject);
begin
TRzSelectFolderForm( RzSelectFolderDialog1.Form ).ShellTree.CustomSort(@CustomSortProc, 0);
end;
This example will reverse sort the nodes in the Shell Tree.
The problem is that there is no simple way to get at the information you want to sort on. That is, the date modified. That information is not tracked with each node in the Shell Tree. You may be able to do some other lookup to get the information you need, then you could modify the CustomSortProc function to sort by modified date.
Ray
We use cookies to improve your experience on our site. By using our site, you consent to cookies.
Manage your cookie preferences below:
Essential cookies enable basic functions and are necessary for the proper function of the website.
These cookies are needed for adding comments on this website.
These cookies are used for managing login functionality on this website.
Stripe is a payment processing platform that enables businesses to accept online payments securely and efficiently.
Service URL: stripe.com (opens in a new window)