TDBPlanner: Ist it possible to skip inactive or certain days with TDBTimeLineSource?

Hello,

the title is basically my question.

As further explanation: I am currently building a new calendar-display, for which I need different persons as Y-axis and multiple days subdivided in a range of hours as X-axis.

The TDBTimeLineSource offers exactly that and works perfectly well for that purpose.

However, if possible, I would like to additionally offer the option of skipping Saturdays and Sundays in the timeline.

Is there a possibility to achieve that using a TDBTimeLineSource? I am aware that the ActiveDay/ActiveDayPeriod-sources are intended for that purpose, but they don’t seem to be capable of displaying what I described above (resources as Y-axis + days/hours-timeline as X-axis).

Assuming you want to hide certain days, this isn’t directly built-in in the TDBTimeLineSource.
If this is for display purposes, you could hide a row or column with:

planner.GridControl.RowHeights[index] := 0
or
planner.GridControl.ColumnWidths[index] := 0

You could also fill the values you want to see along your time axis by setting
Planner.Mode.PlannerType = plCustomList
and fill the list of time values via collection Planner.DateTimeList

Thank you for the suggestion,

hiding the days per GridControl.ColWidths is exactly what I was looking for and completely sufficient for my purpose.

I have encountered just one issue with that approach:

After the first column hidden in that fashion all separator lines between the days coming after aren’t displayed anymore.
I have attached a screenshot showing what I mean.

I had AutoThemeAdapt and all StyleElements deactivated just to be sure.

Is this intended or an error? I assume that I could probably paint the line myself in OnPlannerSideDraw but obviously wouldn’t do that if it is something that will be superceded by a later fix.

Do you hide the exact last column for each day (where the line should be)?

Basically I calculate how many columns I have per day (based on DisplayUnit, TimeLineNVUBegin und TimeLineNVUEnd), then I calculate the position of the days I want to skip (in this case Saturday and Sunday) and then finally I hide ALL columns for each of those days, which includes their last column.

If you prefer, I think it would be trivial for me to put that configuration in a simple example project.

EDIT: The TDBPlanner in the screenshot has Mode.TimeLineNVUBegin=3 and Mode.TimeLineNVUEnd=2, which is responsible for the the missing columns per day. I only manually hide the remaining columns of the days I want to skip completely.

If you could put this in a sample source project with which we can reproduce, that would help.

TestProject.zip (3.6 KB)

Attached is an example unit, in which I hide all Satursdays and Sundays in a simple loop.

As you can see, in the time axis at the top there is only a separator line painted between the first two days, which are Thursday and Friday. The Saturday and Sunday that follow are hidden and afterwards there are no more separator lines between the days.

I haven’t played around with that too much, but it seems to be always the case that the first occurrence of a manually hidden column prevents all further separator lines from being painted in this configuration.