BindingSource::Add Method (Object^)

 

Adds an existing item to the internal list.

Namespace:   System.Windows.Forms
Assembly:  System.Windows.Forms (in System.Windows.Forms.dll)

public:
virtual int Add(
	Object^ value
)

Parameters

value
Type: System::Object^

An Object to be added to the internal list.

Return Value

Type: System::Int32

The zero-based index at which value was added to the underlying list represented by the List property.

Exception Condition
InvalidOperationException

value differs in type from the existing items in the underlying list.

The Add method refers the call to the underlying list's Add method.

The internal list must contain homogenous types. If the DataSource property has not already been set, then the first object added to the list defines the type for the list.

This method raises the ListChanged event.

The following code example how to use the Add method. To run this example, paste the code into a Windows Form, and call the PopulateBindingSourceWithFonts method from the form's constructor.

No code example is currently available or this language may not be supported.

.NET Framework
Available since 2.0
Return to top
Show: