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 Custom Record Browser

Problem

You want to synchronize multiple controls on a form.

Solution

Use data binding with the fields in a DataTable.

Discussion

Recipe Synchronize Controls on a Form showed how you could use data binding to synchronize multiple controls on a Windows Form to a collection of custom objects. The same technique is possible with the DataSet.

As an example, consider the form shown in Figure 14-1. It includes four data-bound controls: a list box, two labels, and a text box. These controls are synchronized, so when you make a new selection in the list box, the other controls are updated with the data from the row. In addition, you can move from row to row using the Next and Prev buttons. Changes are supported for any editable ...

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