Megosztás a következőn keresztül:


BindingNavigator Control Overview (Windows Forms)

 

You can use the BindingNavigator control to create a standardized means for users to search and change data on a Windows Form. You frequently use BindingNavigator with the BindingSource component to enable users to move through data records on a form and interact with the records.

How the BindingNavigator Works

The BindingNavigator control is composed of a ToolStrip with a series of ToolStripItem objects for most of the common data-related actions: adding data, deleting data, and navigating through data. By default, the BindingNavigator control contains these standard buttons. The following screen shot shows the BindingNavigator control on a form.

BindingNavigator Control

The following table lists the controls and describes their functions.

Control Function
AddNewItem button Inserts a new row into the underlying data source.
DeleteItem button Deletes the current row from the underlying data source.
MoveFirstItem button Moves to the first item in the underlying data source.
MoveLastItem button Moves to the last item in the underlying data source.
MoveNextItem button Moves to the next item in the underlying data source.
MovePreviousItem button Moves to the previous item in the underlying data source.
PositionItem text box Returns the current position within the underlying data source.
CountItem text box Returns the total number of items in the underlying data source.

For each control in this collection, there is a corresponding member of the BindingSource component that programmatically provides the same functionality. For example, the MoveFirstItem button corresponds to the MoveFirst method of the BindingSource component, the DeleteItem button corresponds to the RemoveCurrent method, and so on.

If the default buttons are not suited to your application, or if you require additional buttons to support other types of functionality, you can supply your own ToolStrip buttons. Also see How to: Add Load, Save, and Cancel Buttons to the Windows Forms BindingNavigator Control.

See Also

BindingNavigator
BindingSource
BindingNavigator Control