HomeActive Query Builder - HowTos and TroubleshootingActive Query Builder ASP.NET EditionHow to setup grouping type and initial selection of objects in the Database Schema Tree?

3.12. How to setup grouping type and initial selection of objects in the Database Schema Tree?

Grouping of objects within the Database Schema Tree is defined by the Metadata Structure object. It can be accessed via the QueryBuilder.MetadataStructure property.

To change objects grouping in the Database Schema Tree, set the QueryBuilder.MetadataStructureOptions.GroupBy* properties in the Init event handler.

Attention: The rest of the article describes usage of the old Database Schema List control (AQB:ObjectTree), it is not applicable to the new Database Schema Tree (AQB:ObjectTreeView).

To instruct the component to expand specific group on loading, use the ObjectTree.Path property. This property gets and sets a slash-separated string of group names according to the grouping defined by Metadata Structure "GroupBy*" properties. The trailing asterisk item in this string instructs to show all objects from this group. Usage of the asterisk item is allowed only if the ShowAllItemInGroupingSelectLists property is set to True. Non-existing group names assigned to the ObjectTree.Path property will be ignored.

Examples:

  • Instructuing to show tables the "Production" schema of "AdventureWorks" database:
    ObjectTree.Path = "/AdventureWorks/Production/Tables"
  • Instructuing to show all objects the "dbo" schema of "Northwind" database (regargless of absense or presence of further grouping by object type):
    ObjectTree.Path = "/Northwind/dbo/*"
  • Instructuing to show all objects from the Metadata Container:
    ObjectTree.Path = "*"

This page was: Helpful | Not Helpful