Back to Devexpress

MasterDetailInfoCollection Class

corelibraries-devexpress-dot-dataaccess-dot-datafederation-4549cfdf.md

latest3.3 KB
Original Source

MasterDetailInfoCollection Class

A collection of the FederationMasterDetailInfo objects that define master-detail relationships.

Namespace : DevExpress.DataAccess.DataFederation

Assembly : DevExpress.DataAccess.v25.2.dll

NuGet Package : DevExpress.DataAccess

Declaration

csharp
public sealed class MasterDetailInfoCollection :
    List<FederationMasterDetailInfo>
vb
Public NotInheritable Class MasterDetailInfoCollection
    Inherits List(Of FederationMasterDetailInfo)

The following members return MasterDetailInfoCollection objects:

Remarks

The FederationDataSource.Relations property provides access to a MasterDetailInfoCollection instance.

Example

To create a master-detail relationship between two queries, add an instance of the FederationMasterDetailInfo object to the Relations collection:

Note

The complete sample project How to Create a Federated Data Source at Runtime is available in the DevExpress Examples repository.

csharp
using DevExpress.DataAccess.DataFederation;
// ...
  federation.Relations.Add(new FederationMasterDetailInfo() {
      MasterQueryName = "Orders",
      DetailQueryName = "OrderDetail",
      KeyColumns = {
          new FederationRelationColumnInfo(){
              ParentKeyColumn="OrderID",
              NestedKeyColumn ="OrderID",
              ConditionOperator= FederationConditionType.Equal
              }
          }
  }
vb
Imports DevExpress.DataAccess.DataFederation
' ... 
  federation.Relations.Add(
      New FederationMasterDetailInfo("Orders",
                                      "OrderDetail", 
                                      New FederationRelationColumnInfo() With
                                      {.ParentKeyColumn = "OrderID",
                                      .NestedKeyColumn = "OrderID",
                                      .ConditionOperator = FederationConditionType.Equal}))

Inheritance

Object List<FederationMasterDetailInfo> MasterDetailInfoCollection

See Also

MasterDetailInfoCollection Members

DevExpress.DataAccess.DataFederation Namespace