O'Reilly logo

Microsoft® Visual Basic® .NET Programmer's Cookbook by Matthew MacDonald

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Create a Master-Details Form

Problem

You need to create a form that allows users to navigate a parent-child relationship.

Solution

React to the CurrencyManager.PositionChanged event for the parent table, and update the DataView.RowFilter used for the child table.

Discussion

You can create a master-details form using data binding and row filtering. In this case, you need to bind two separate tables. The row position will be tracked separately for each table. When a row is selected in the parent table, you can configure the child table to show only the related rows by modifying the corresponding DataView.RowFilter property (as introduced in recipe Filter or Sort Data with a DataView). Figure 14-3 shows an example with two DataGrid controls. The top-most ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required