Sort child tables for a recursive data-relation
- Last Updated: January 17, 2024
- 1 minute read
- OpenEdge
- Version 12.8
- Documentation
If a grid control is bound to a ProDataSet with a recursive data-relation, it presents an additional level of complexity. When the recursive data-relation is defined in the ProDataSet, it has a single buffer for the child table. For example:
|
But because the data-relation is defined recursively,
this maps to multiple bands in the grid's hierarchical control.
A band consists of all the records at a given level
in the hierarchical display. Internally, the AVM needs to create
a separate buffer for each band in the control, each with a unique
buffer name. For example, if you have defined the following recursive
data-relation with child table ttemp, the AVM will
create a new buffer object for each band in the hierarchy naming
them ttemp1, ttemp2, ttemp3,
and so on.
You need to be aware of this if you are subscribing
to the grid's sort event and writing your own sorting code in ABL.
The band's key name from the grid control will be the unique buffer
name, the one corresponding to the band that the sort request was
made from. When using this to set a new value for the data-relation WHERE-STRING attribute
in the sort event handler, you must map it to the original child
table's buffer name. For example, using an UltraGrid control:
|