System.Windows.Forms
1.0.5000.0
2.0.0.0
System.Windows.Forms.BindingManagerBase
The derives from the class. Use the to return either a or a . The actual object returned depends on the data source and data member passed to the property of the . If the data source is an object that can return only a single property (instead of a list of objects), the type will be a . For example, if you specify a as the data source, a will be returned. If, on the other hand, the data source is an object that implements the , , or interface, a will be returned.
The property returns the current item in the underlying list. To change the current item, set the property to a new value. The value must be greater than 0 and must be less than the value of the property.
If the underlying data source implements the interface, and the property is set to true, you can use the method.
Manages a list of objects.
Method
System.Void
This method is supported only if the data source implements the interface and the data source allows adding rows ( is true).
This property was designed to allow complex-bound controls, such as the control, to add new items to list.
You typically use this property only if you are creating your own control that incorporates the . Otherwise, to add items if the data source is a , use the method of the class. If the data source is a , use the method and add the row to the .
Adds a new item to the underlying list.
1.0.5000.0
2.0.0.0
Method
System.Void
This method is supported only if the objects contained by the data source implement the interface. If the objects contained within the data source do not implement the interface, changes made to the data will not be discarded.
This property was designed to be used by complex data-bound controls, such as the control, to cancel edits. For example, when the user presses the ESC key, the method is called on the for the . Unless you are creating a control that requires this same functionality, you should not use this method. Instead, use the method of the class.
Cancels the current edit operation.
1.0.5000.0
2.0.0.0
Method
System.Void
To be added.
Throws an exception if there is no list, or the list is empty.
1.0.5000.0
2.0.0.0
Property
System.Int32
To be added.
Use the count property to determine when the end of a list has been reached. Because the maintains a 0-based array of items, the end of the list is always minus one.
Gets the number of items in the list.
1.0.5000.0
2.0.0.0
Property
System.Object
To be added.
In order to get the current item, you must know its data type in order to cast it correctly. For example, if the data source is a or , you must cast the current item as a object.
Gets the current item in the list.
1.0.5000.0
2.0.0.0
Method
System.Void
This method is supported only if the objects contained by the data source implement the or interfaces.
This property was designed to be used by complex data-bound controls, such as the control. Unless you are creating a control that requires this same functionality, you should not use this method. Instead, if the data source is either a or , use the method of the class.
Ends the current edit operation.
1.0.5000.0
2.0.0.0
Field
System.Type
To be added.
Specifies the data type of the list.
1.0.5000.0
2.0.0.0
Method
System.ComponentModel.PropertyDescriptorCollection
The for the is used to specify a column in the list.
Gets the property descriptor collection for the underlying list.
A for the list.
1.0.5000.0
2.0.0.0
Method
1.0.5000.0
2.0.0.0
System.String
For the method to be successful, the underlying list must be of type .
Gets the name of the list supplying the data for the binding using the specified set of bound properties.
If successful, a containing name of the list supplying the data for the binding; otherwise, an string.
An of properties to be found in the data source.
Event
System.Windows.Forms.ItemChangedEventHandler
The event will occur when the user calls the or method.
The event occurs only when the item itself has been changed in some manner. For example, if the value of an item is changed from 10 to 42, the event will occur. This should not be confused with the event where the item has been changed to a new item.
The event will also occur if the underlying data changes. For example, if you change the value of a , the event will occur.
If you are creating your own control that uses the , you should use the instead of the event. The property of the enables you to determine the type of action that has occurred.
For more information about handling events, see Consuming Events.
Occurs when the current item has been altered.
1.0.5000.0
2.0.0.0
Property
System.Collections.IList
To be added.
The object returned by the property can be cast to any type that implements the interface. This will be commonly used when you know the type of the underlying list. For example, if you are data-bound to a , the underlying list is a (which implements ). Other classes that implement the interface (this is not a complete list) include , , and .
How you use the property depends on the class that implements the interface. For example, you can use the property to determine the name of the list. If the data source implements the interface, you can use the method to return the name of the current table. This is shown in the C# code below:
private void PrintCurrentListName(DataGrid myDataGrid){
CurrencyManager myCM = (CurrencyManager)
BindingContext[myDataGrid.DataSource, myDataGrid.DataMember];
IList myList = myCM.List;
ITypedList thisList = (ITypedList) myList;
Console.WriteLine(thisList.GetListName(null));
}
Gets the list for this .
1.0.5000.0
2.0.0.0
Event
2.0.0.0
System.ComponentModel.ListChangedEventHandler
The event is thrown by the class when changes to an item are made using methods such as , , and . This event can also occur when the data source is edited directly if it implements the interface.
The associated OnListChanged method is a private method in this class.
For more information about handling events, see Consuming Events.
Occurs when the list changes or an item in the list changes.
Field
System.Int32
If the value of the property is greater than 0, the field is a number between 0 and minus 1. If is 0, is -1.
Specifies the current position of the in the list.
1.0.5000.0
2.0.0.0
Event
System.EventHandler
The metadata of the consists of the schema of the underlying . The event is raised when that schema has changed. For example, the event is raised when a is programmatically added to a .
For more information about handling events, see Consuming Events.
Occurs when the metadata of the has changed.
1.0.5000.0
2.0.0.0
Method
1.0.5000.0
2.0.0.0
System.Void
To be added.
To be added.
The that contains the event data.
Method
2.0.0.0
System.Void
To be added.
To be added.
The that contains the event data.
Method
System.Void
Raising an event invokes the event handler through a delegate. For more information, see Raising an Event.
The method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class.
Raises the event.
An that contains the event data.
1.0.5000.0
2.0.0.0
Method
2.0.0.0
System.Void
Raising an event invokes the event handler through a delegate. For more information, see Raising an Event.
The method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class.
Raises the event.
An that contains the event data.
Method
System.Void
Raising an event invokes the event handler through a delegate. For more information, see Raising an Event.
The method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class.
Raises the event.
An that contains the event data.
1.0.5000.0
2.0.0.0
Property
System.Int32
To be added.
An important property of the class is the property. In a list of items, you can view only one item out of the entire list. To determine which item is viewed, set the to a number between 0 (the beginning of the list) and minus 1 (the end of the list).
Therefore, the determines the currency, or place in the list, of all controls bound to the same . For example, imagine a list consisting of two columns called "FirstName" and "LastName". Two controls are bound to the same list; the first control is bound to the first column, and the second control is bound to the second column. When the of the common is set to the third position, both controls display the appropriate values for that position in the list. In other words, if the item at position three consists of the first name "John" and the last name "Smith", the bound controls will display "John" and "Smith".
Gets or sets the position you are at within the list.
1.0.5000.0
2.0.0.0
Method
System.Void
Use the method when the data source does not support notification when it is changed (for example, if it is an ).
Forces a repopulation of the data-bound list.
1.0.5000.0
2.0.0.0
Method
System.Void
The method was designed to allow complex controls, such as the control, to remove items from the list. You should not use this method to actually remove items. Instead, use the method of the class to delete items.
Removes the item at the specified index.
The index of the item to remove from the list.
1.0.5000.0
2.0.0.0
Method
System.Void
and are two methods that allow the temporary suspension and resumption of in a simple data binding scenario. You would typically suspend data binding if the user must be allowed to make several edits to data fields before validation occurs. For example, if one field must be changed in accordance with a second, but where validating the first field would cause the second field to be in error.
Using prevents changes from being pushed into the data source until is called but does not prevent changes in the data source from affecting the bound controls. Controls that use complex data binding, such as the control, update their values based on change events such as the event. Calling this method will not prevent these events from occurring. For this reason, and are designed for use with simple-bound controls, such as a . Alternatively, you can use these methods in a complex binding scenario if you suppress events by setting the property to false.
Resumes data binding.
1.0.5000.0
2.0.0.0
Method
System.Void
The and methods allow the temporary suspension and resumption of data binding in a simple binding scenario. You would typically suspend data binding if the user must make several edits to data fields before validation occurs. For example, if one field must be changed in accordance with a second, but where validating the first field would cause the second field to be in error.
prevents changes from being applied to the data source until is called, but does not actually prevent any events from occurring. Controls that use complex data binding, such as the control, update their values based on change events, such as the event. Therefore, calling will not prevent complex-bound controls from receiving events to update the data source. For this reason, and are designed for use with simple-bound controls, such as the control. Alternatively, you can use these methods in a complex binding scenario if you suppress events by setting the property to false.
Suspends data binding to prevents changes from updating the bound data source.
1.0.5000.0
2.0.0.0
Method
System.Void
To be added.
Updates the status of the binding.
1.0.5000.0
2.0.0.0