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


combit.ListLabel24.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
Syntax
'Declaration
 
Public NotInheritable Class ObjectDataProvider 
   Implements ICanHandleUsedIdentifiers, IDataProvider, combit.ListLabel24.ISupportsLogger 
public ref class ObjectDataProvider sealed : public ICanHandleUsedIdentifiers, IDataProvider, combit.ListLabel24.ISupportsLogger  
Example
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);
LL.Design();
Class Car
	Private m_Brand As String
	Public Property Brand() As String
		Get
			Return m_Brand
		End Get
		Set
			m_Brand = Value
		End Set
	End Property
	
	Private m_Model As String
	Public Property Model() As String
		Get
			Return m_Model
		End Get
		Set
			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)
LL.Design()
Inheritance Hierarchy

System.Object
   combit.ListLabel24.DataProviders.ObjectDataProvider

Requirements

Platforms: Windows Vista - Windows 10 Version 1809, Windows Server 2008 - 2016

See Also

Reference

ObjectDataProvider Members
combit.ListLabel24.DataProviders Namespace