--- title: "BindingSource Component Overview" ms.date: "03/30/2017" helpviewer_keywords: - "Windows Forms, data binding" - "controls [Windows Forms], binding to data" - "BindingSource component [Windows Forms], about BindingSource component" - "data binding [Windows Forms], BindingSource component" ms.assetid: be838caf-fcb0-4b68-827f-58b2c04b747f --- # BindingSource Component Overview The component is designed to simplify the process of binding controls to an underlying data source. The component acts as both a conduit and a data source for other controls to bind to. It provides an abstraction of your form's data connection while passing through commands to the underlying list of data. Additionally, you can add data directly to it, so that the component itself functions as a data source. ## BindingSource Component as an Intermediary The component acts as the data source for some or all of the controls on the form. In Visual Studio, the can be bound to a control by means of the `DataBindings` property, which is accessible from the **Properties** window. Also see [How to: Bind Windows Forms Controls with the BindingSource Component Using the Designer](bind-wf-controls-with-the-bindingsource.md). You can bind the component to both simple data sources, like a single property of an object or a basic collection like , and complex data sources, like a database table. The component acts as an intermediary that provides binding and currency management services. At design time or run time, you can bind a component to a complex data source by setting its and properties to the database and table, respectively. The following illustration demonstrates where the component fits into the existing data-binding architecture. ![Binding Source and Data Binding Architecture](./media/net-bindsrcdatabindarch.gif "NET_BindSrcDataBindArch") > [!NOTE] > At design time, some actions, like dragging a database table from a data window onto a blank form, will create the component, bind it to the underlying data source, and add data-aware controls all in one operation. Also see [Bind Windows Forms controls to data in Visual Studio](/visualstudio/data-tools/bind-windows-forms-controls-to-data-in-visual-studio). ## BindingSource Component as a Data Source If you start adding items to the component without first specifying a list to be bound to, the component will act like a list-style data source and accept these added items. Additionally, you can write code to provide custom "AddNew" functionality by means of the event, which is raised when the method is called prior to the item being added to the list. For more information, see [BindingSource Component Architecture](bindingsource-component-architecture.md). ## Navigation For users that need to navigate the data on a form, the component enables you to navigate and manipulate data, in coordination with a component. For more information, see [BindingNavigator Control](bindingnavigator-control-windows-forms.md). ## Data Manipulation The: acts as a for all of its bindings and can, therefore, provide access to currency and position information regarding the data source. The following table shows the members that the component provides for accessing and manipulating the underlying data. |Member|Description| |------------|-----------------| | property|Gets the current item of the data source.| | property|Gets or sets the current position in the underlying list.| | property|Gets the list that is the evaluation of the and evaluation. If is not set, returns the list specified by .| | method|Inserts an item in the list at the specified index.| | method|Removes the current item from the list.| | method|Applies pending changes to the underlying data source.| | method|Cancels the current edit operation.| | method|Adds a new item to the underlying list. If the data source implements and returns an item from the event, adds this item. Otherwise, the request is passed to the list's method. If the underlying list is not an , the item is automatically created through its public parameterless constructor.| ## Sorting and Filtering Usually, you should work with an ordered or filtered view of the data source. The following table shows the members that the component data source provides. |Member|Description| |------------|-----------------| | property|If the data source is an , gets or sets a column name used for sorting and sort order information. If the data source is an and supports advanced sorting, gets multiple column names used for sorting and sort order information| | property|If the data source is an , gets or sets the expression used to filter which rows are viewed.| ## See also - - - [BindingSource Component Architecture](bindingsource-component-architecture.md) - [BindingSource Component](bindingsource-component.md) - [BindingNavigator Control](bindingnavigator-control-windows-forms.md) - [Windows Forms Data Binding](../windows-forms-data-binding.md) - [Controls to Use on Windows Forms](controls-to-use-on-windows-forms.md)