Blog
All Blog Posts | Next Post | Previous Post
Filter and Sort your tasks in TMS FNC Gantt Chart
Wednesday, September 17, 2025
When working with large projects, finding the right tasks in a Gantt Chart can be challenging. Without the right tools, it can be difficult to focus on what matters most. Thats why the TMS FNC Gantt Chart introduces two powerful features:
-
Filtering to select only the tasks you need to see.
-
Sorting to organize tasks in the order that makes sense to you.
Together, these features give you full control over how tasks are displayed.
Task Filtering
At the core of filtering is the TTMSFNCFilterBuilder logic in theTTMSFNCGanttChartFilter class. It allows you to build filter expressions programmatically. You can add simple or complex conditions, combine them with AND and OR.
Building Filters
To use filtering, your refer to the different property names that are used for the columns to automatically fill in the Gantt Chart List and these are: wbs, taskname, taskdescription, startdate, enddate, duration, statename, progress, cost, dependencies, datastring, datainteger, databoolean.
begin
TMSFNCGanttChart.Filter.AddAND('taskname', feoStartsWith, 'D');
TMSFNCGanttChart.Filter.AddAND('progress', feoSmallerThan, 50);
end;
begin
// Default format: TMSFNCGanttChart1.Filter.FormatType := fftDelphiDataSet;
TMSFNCGanttChart1.Filter.Parse('[taskname] LIKE ''D%'' AND [progress] < 50');
TMSFNCGanttChart1.Filter.FormatType := fftUniversalFilterExpressions;
TMSFNCGanttChart1.Filter.Parse('[taskname] = "D*" & [progress] < 50');
end;Managing Filters
You can quickly reset a filter with the Clear procedure.
It is easy to check whether you are already filtering on a given property with the HasFilter function, and to clear all of the expressions that are using a given property name via RemovePropertyFilter.
Filter Hierarchy Mode
Filtering also defines how the hierarchy around filtered tasks is displayed. For this, we use the FilterHierarchyMode property:
| Mode | Description |
|---|---|
gfhParent | Shows matching tasks and their parents, keeping the full context. (Default value.) |
gfhChildren | Shows matching tasks and all of their children (subtree). |
gfhBoth | A combination of Parent and Children. |
gfhStrict | Shows only the tasks that match the filter. |
Visual examples for tasks starting with "D":

Children Hierarchy:



Task Sorting
You can also sort tasks. This is done on a project level. And changes the position of the tasks in the collection.
The sorting works with the property names, in the same way as the filtering and column names. (wbs, taskname, taskdescription, startdate, enddate, duration, statename, progress, cost, dependencies, datastring, datainteger, databoolean.)
The sorting can be enabled on the Column property of the Gantt Chart which will trigger when clicking on the header of the Gantt List Column. Or programmatically with the sort method.
GanttChart.Project.Sort( 'wbs', // Property to sort on True, // Recurse into subtasks True, // Case-sensitive True // Ascending order );
Conclusion
The TMS FNC Gantt Chart now provides a rich set of tools for filtering and sorting tasks. Whether you want to zoom in on specific conditions, maintain context with parents or children, or reorder tasks by date, name, or WBS you are in full control of how project data is presented.
With these features combined, managing even the most complex projects becomes intuitive and efficient.
Gjalt Vanhouwaert
This blog post has not received any comments yet.
All Blog Posts | Next Post | Previous Post