O'Reilly logo

Visual Basic 2012 Programmer's Reference by Rod Stephens

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

CURRENCYMANAGER

Some controls such as the DataGrid control provide their own forms of navigation. If you bind a DataGrid to a DataSet, it allows the user to examine the DataSet object’s tables, view and edit data, and follow links between the tables. The DataGrid provides its own methods for navigating through the data. For simpler controls, such as the TextBox, which can display only one data value at a time, you must provide some means for the program to navigate through the data source’s records.

A data source manages its position within its data by using a CurrencyManager object. The CurrencyManager supervises the list of Binding objects that bind the data source to controls such as TextBoxes.

NOTE
The name CurrencyManager has nothing to do with money. Here “currency” refers to the current record, not cash.

The following table describes the CurrencyManager object’s most useful properties.

PROPERTY PURPOSE
Bindings A collection of the bindings that the object manages.
Count Returns the number of rows associated with the CurrencyManager.
Current Returns a reference to the current data object (row).
List Returns an object that implements the IList interface that provides the data for the CurrencyManager. For example, if the data source is a DataSet or DataTable, this object is a DataView.
Position Gets or sets the current position within the data. For example, in a DataTable this is the row number.

The CurrencyManager also provides some methods for manipulating ...

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