xpo-devexpress-dot-xpo-dot-xpdataview-dot-loadordereddata-x28-devexpress-dot-xpo-dot-loaddatamemberorderitem-devexpress-dot-xpo-dot-db-dot-selecteddata-x29.md
Loads data from the specified result set to the data view, mapping data view columns to result set columns.
Namespace : DevExpress.Xpo
Assembly : DevExpress.Xpo.v25.2.dll
NuGet Package : DevExpress.Xpo
public void LoadOrderedData(
LoadDataMemberOrderItem[] members,
SelectedData data
)
Public Sub LoadOrderedData(
members As LoadDataMemberOrderItem(),
data As SelectedData
)
| Name | Type | Description |
|---|---|---|
| members | LoadDataMemberOrderItem[] |
An array of LoadDataMemberOrderItem objects which provide mapping information.
| | data | SelectedData |
An SelectedData object which represents a result set providing data to be loaded into the data view.
|
Call the LoadOrderedData method to map data view columns to result set columns when loading data into the XPDataView when any of the following is true:
Otherwise, call the XPDataView.LoadData method.
Note
If the number of columns within the XPDataView.Properties collection and data result set do not match, the LoadOrderedData method throws an exception.
The following code snippet demonstrates how to use column mapping information to populate the XPDataView with columns, and load data.
// The result set retrieves four columns.
DevExpress.Xpo.DB.SelectedData resultSet =
session1.ExecuteQuery("SELECT Oid, Age, Name, BigPicture FROM [Person]");
// The data view will display only two of them - Name and Age.
// We map these columns to corresponding result set columns,
// using their indexes in the result set.
LoadDataMemberOrderItem[] personsLoadOrder = new LoadDataMemberOrderItem[] {
new LoadDataMemberOrderItem(2, "Name"),
new LoadDataMemberOrderItem(1, "Age")
};
// The data view is populated with columns and loads its data
// using the specified mapping information.
xpDataView1.PopulatePropertiesOrdered(session1.GetClassInfo<Person>(), personsLoadOrder);
xpDataView1.LoadOrderedData(personsLoadOrder, resultSet);
' The result set retrieves four columns.
Dim resultSet As DevExpress.Xpo.DB.SelectedData = _
session1.ExecuteQuery("SELECT Oid, Age, Name, BigPicture FROM [Person]")
' The data view will display only two of them - Name and Age.
' We map these columns to corresponding result set columns,
' using their indexes in the result set.
Dim personsLoadOrder() As LoadDataMemberOrderItem = { _
New LoadDataMemberOrderItem(2, "Name"), _
New LoadDataMemberOrderItem(1, "Age")
}
' The data view is populated with columns and loads its data
' using the specified mapping information.
xpDataView1.PopulatePropertiesOrdered(session1.GetClassInfo(Of Person)(), personsLoadOrder)
xpDataView1.LoadOrderedData(personsLoadOrder, resultSet)
See Also