Represents the navigation and manipulation user interface (UI) for controls on a form that are bound to data.
See Also: BindingNavigator Members
The System.Windows.Forms.BindingNavigator control represents a standardized way to navigate and manipulate data on a form. In most cases, a System.Windows.Forms.BindingNavigator is paired with a System.Windows.Forms.BindingSource control to move through data records on a form and interact with them. In these cases, the BindingNavigator.BindingSource property is set to the associated System.Windows.Forms.BindingSource component that acts as a data source.
By default, the System.Windows.Forms.BindingNavigator control's user interface (UI) is composed of a series of System.Windows.Forms.ToolStrip buttons, text boxes, and static text elements for most common data-related actions, such as adding data, deleting data, and navigating through data. Each of these controls can be retrieved or set through an associated member of the System.Windows.Forms.BindingNavigator control. Likewise, there is also a one-to-one correspondence to members within the System.Windows.Forms.BindingSource class that programmatically perform the same functionality, as shown in the following table.
Move First | ||
Move Previous | ||
Current Position | ||
Count | ||
Move Next | ||
Move Last | ||
Add New | ||
Delete |
Adding a System.Windows.Forms.BindingNavigator control to a form and binding it to a data source, such as a System.Windows.Forms.BindingSource, will automatically establish the relationships in this table.
You can use one of the following techniques to customize this toolbar:
Create the System.Windows.Forms.BindingNavigator with the BindingNavigator.#ctor(bool) constructor, which accepts a Boolean addStandardItems parameter, and set this parameter to false. Then add the desired System.Windows.Forms.ToolStripItem objects to the ToolStrip.Items collection.
If a great deal of customization is desired, or the custom design will be reused, derive a class from System.Windows.Forms.BindingNavigator and override the BindingNavigator.AddStandardItems method to define additional or alternate standard items.