Property Boolean pbAutoFillFromFirst
Read Access: | Get pbAutoFillFromFirst to BooleanVariable |
Write Access: | Set pbAutoFillFromFirst to BooleanVariable/Value |
pbAutoFillFromFirst is a DDO property created to allow child DDOs to auto-fill from the first record. This can be used to great advantage and flexibility with the dbGrid/dbList properties Initial_Row and pbReverseOrdering.
When a child DDO is related to a parent with a relates-to constraint, the auto_fill_state property of the child DDO determines what it should do when the parent record changes.
If auto_fill_state is set false, the child DDO is cleared when the parent record changes.
If auto_fill_state is set to true, the first valid child is found.
Although auto_fill_state is a DD property you usually don't need to set it explicitly in the DDO. DbGrids will automatically set their DDO's auto_fill_state to true. This is what makes child dbGrids work as they do. When the child DDO auto-finds the first record it notifies the dbGrid that it has a new record. The dbGrid then fills in the rest of records and you see a populated grid.
The property pbAutoFillFromFirst, allows you to determine if the auto-fill record should be the first valid record or the last valid record. The default value for this property is True. This means the first record will be found which is how DataFlex has always worked. Setting this property to false will force the last record to be found.
This property is most useful when used with a child DDO that has a dbGrid attached to it. It can be used in conjunction with the dbGrid properties Initial_Row and pbReverseOrdering.
For example, setting the DDO's pbAutoFillFromFirst to False and setting the dbGrid's Initial_Row property to FILL_FROM_BOTTOM will cause the order entry sample to fill its detail grid from the last record located at the bottom of the grid.
Or, setting a dbGrid's pbReverseOrdering property to True and setting the DDO's pbAutoFillFromFirst property to False would display a grid with the last record presented in the first row and other records displayed in reverse order. This might be useful if your dbGrid is displaying dates which you want displayed with the most recent date displayed first.
Remember that pbAutoFillFromFirst is set inside of the DD object. The properties Initial_Row and pbReverseOrdering are set in the dbGrid (or dbList) object.
Default is true.