Hello
There is special property DBGridEh.DataGrouping.GroupDataTree - Tree list of all grouping elements in the form of a tree.
You can also access the array of grouping items as a flat list.
- DBGridEh.DataGrouping.GroupDataTree.FlatVisibleItem[const Index: Integer]: TGroupDataTreeNodeEh
- DBGridEh.DataGrouping.GroupDataTree.FlatVisibleCount - The number of elements in the list of visible expanded branches of the grouping tree.
Property that point to the current TreeNode which corresponds to the current record of the grid.
- DBGridEh.DataGrouping.CurDataNode
To change the status of the Expanded property for the current branch of the grouping tree, you can use the following code.
Code:
procedure TForm1.Button1Click(Sender: TObject);
begin
if DBGridEh1.DataGrouping.CurDataNode.NodeType = dntDataGroupEh then
DBGridEh1.DataGrouping.CurDataNode.Expanded := not DBGridEh1.DataGrouping.CurDataNode.Expanded;
end;
Read more about the properties of the TGridGroupDataTreeEh class in the section "Working with datain grouping mode." of "EhLib Users Guide.doc" file.