The following example assumes there are two groups defined through the designer in the ShellList for grouping folders and files in a ShellListView.
procedure TMainForm.ShellListAddItem(Item: TJamShellListItem; var CanAdd: Boolean); begin if Item.IsFolder then Item.GroupID := cGroupIdFolders //the GroupID of the respective group else Item.GroupID := cGroupIdFiles; end;