ComponentOne True DBGrid for .NET (2.0) Search HelpCentral 

Drop-Down Hierarchical Data Display

True DBGrid for .NET allows you to display a master/child relationship between data sources in such a way that the child data records are available from within the master table in a completely new True DBGrid. By simply setting the ChildGrid property to connect two grid controls and a few lines of code, you can create a fully editable drop-down child that appears within the master table with a simple click.

Assuming that your hierarchical dataset is already configured, you can create the master/child relationship by selecting C1TrueDBGrid2 in the ChildGrid property of C1TrueDBGrid1.

Notice that C1TrueDBGrid2 is rendered invisible and there is an expand icon ("+") beside the left most cell in each row. The master table contains a list of composers including vital statistics. Note, that as you scroll right, the expand icon remains in the left most cell at all times.

By left clicking on any of the expand icons, our child table appears in a drop-down. In this case, the drop-down lists the written works of the specific composer that you expanded.

This demonstrates how very simple it is to attach a child grid to its master grid and display hierarchical data in a convenient display.


Send comments about this topic to ComponentOne.
Copyright © ComponentOne LLC. All rights reserved.