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

Synchronize Controls on a Form

Problem

You want to create a record-browser where all control values are updated automatically for the current record.

Solution

Use a custom class to encapsulate the data, add instances of it to an ArrayList collection, and use .NET data binding.

Discussion

.NET data binding is most commonly used in ADO.NET applications, where you need to display one or more records in a DataTable. However, it can be used just as easily in other types of applications by replacing the DataTable or DataSet with a collection of custom objects.

For example, consider an example where you want to use multiple controls to show different pieces of information about a person. The person information is wrapped into a dedicated class, which is shown ...

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