HeaderDrawProp event

hi i want to assign a color in the HeaderDrawProp event of an resource dependant of the value of resource dataset field. For example

if FieldByName('Is_Dirty').AsBoolean Then
How can get directly the field value of the resource dataset associated to the planner ?
i've a TDBTimeLineSource
Thank u

In other words i want to color a header dependant of the value of the specified resource field !


This depends on how you map resources to positions in the Planner.
If you used the TDBTimeLineSource.ResourceMap, you can convert the position (index) of the header to the value of the DB resource field via DBTimeLineSource.PosToRes(index): integer;

If you used TDBTimeLineSource.OnResourceToPosition / TDBTimeLineSource.OnPositionToResource, you'll need to apply that same logic in OnHeaderDrawProp.