Active Query Builder support area

Schema Expand

Avatar
  • updated
  • Completed

I had hoped that setting Expand Level to -1 would expand the schema nodes. The dbo node does not get expanded (see screenshot below). Am I using it wrong?

Avatar
Andrey Zavyalov, PM

Hello, Kay.

Sorry for the outdated settings form in our basic demos.

In version 3.5, we replaced the DefaultExpandLevel property with two new properties which are more predictable in the case of working with different database servers and DB schema grouping settings. There are now two properties in the QueryBuilder.DatabaseSchemaViewOptions group: DefaultExpandMetadataType property of MetadataType enum and DefaultExpandFolderNodes boolean property.

The DefaultExpandMetadataType property determines types of metadata objects that should be expanded by default. The DefaultExpandFolderNodes determines whether grouping nodes which don't correspond to any metadata object (such as "Tables", "Views" and "Procedures" nodes if MetadataStructureOptions.GroupByTypes = true) should be expanded or not.

You can set the DefaultExpandMetadataType to All to expand all the tree, but please note that if you display fields in the tree (MetadataStructureOptions.ShowFields = true), the process of initial expansion may take a long time, so maybe it is better to expand namespaces (Server | Database | Schema | Package) only.

There is a much more sophisticated properties form in the Full-featured MDI demo, I recommend you to learn the component using this demo. Note that in this demo, the Properties form is available only when you have a query window opened (Main menu "Options" - "Properties" item).

Avatar
Kay Bren

Ok thx! It works. I just want to see the table names so I'm using:

queryBuilder1.DatabaseSchemaView.Options.DefaultExpandMetadataType = MetadataType.Database | MetadataType.Schema;
queryBuilder1.DatabaseSchemaView.Options.DefaultExpandFolderNodes = true;

and also I noticed that after assigning the context I need to call InitalizeDatabaseSchemaTree as well:

queryBuilder1.SQLContext.Assign(context);
queryBuilder1.DatabaseSchemaView.InitializeDatabaseSchemaTree();

Works great. Thx!

 

Avatar
Kay Bren

Just one more thing.

Calling

InitializeDatabaseSchemaTree

seems to turn off my wait cursor. I usually turn the wait cursor on by calling:

Cursor.Current = Cursors.WaitCursor;

however the Wait Cursor turns off as soon as IntializeDatabaseSchemaTree is hit.

Avatar
Andrey Zavyalov, PM

The bug with the reset of the cursor has been fixed.