combit List & Label 25 - .NET Online Web Help
ObjectDataProvider Class
Members  Example 

combit.ListLabel25.DataProviders Namespace : ObjectDataProvider Class

This data provider can be used to access object structures. It is capable to work with the following types/interfaces:

In order to influence the property names and types, you may either implement the ITypedList interface on your class or use the DisplayNameAttribute. To suppress members, use the Browsable(false) attribute on the members.

The provider can parse empty enumerations as well as long as they are strongly typed. Otherwise, at least one element is required in the enumeration and this first element determines the type that is used for further parsing.

The provider automatically supports sorting as soon as the data source implements the IBindingList interface.

You may also use this data provider to access LINQ query results, as they are IEnumerable<T>.

When using EntityCollection<T> objects as data source the ObjectDataProvider first checks the state of the sub relation by querying the IsLoaded property and dynamically calls Load() if necessary. This way, the data is only queried when needed.

Object Model
ObjectDataProvider Class
Public NotInheritable Class ObjectDataProvider 
   Implements ICanHandleUsedIdentifiers, IDataProvider, combit.ListLabel25.ISupportsLogger 
public ref class ObjectDataProvider sealed : public ICanHandleUsedIdentifiers, IDataProvider, combit.ListLabel25.ISupportsLogger  
class Car
    public string Brand { get; set; }
    public string Model { get; set; }

List<Car> cars = new List<Car>();
cars.Add(new Car { Brand = "VW", Model = "Passat"});
cars.Add(new Car { Brand = "Porsche", Model = "Cayenne"});
LL.DataSource = new ObjectDataProvider(cars);
Class Car
	Private m_Brand As String
	Public Property Brand() As String
			Return m_Brand
		End Get
			m_Brand = Value
		End Set
	End Property
	Private m_Model As String
	Public Property Model() As String
			Return m_Model
		End Get
			m_Model = Value
		End Set
	End Property
End Class

Dim cars As New List(Of Car)()
cars.Add(New Car() With {.Brand = "VW", .Model = "Passat"})
cars.Add(New Car() With {.Brand = "Porsche", .Model = "Cayenne"})
LL.DataSource = New ObjectDataProvider(cars)
Inheritance Hierarchy



Platforms: Windows 7 SP1 - Windows 10 Version 1909, Windows Server 2008 R2 - 2019

See Also


ObjectDataProvider Members
combit.ListLabel25.DataProviders Namespace