This property is accessed to query the child key column name. Combined keys can be passed with the separator "\t". Your data provider should therefore deliver for example "CustomerID\tOrderID" and the corresponding child fields. In the ApplyFilter() Method of the ITable Interface the values are arriving exactly like that, a filter string could look like following:
"CustomerID\tOrderID=22\t14"
The GetChildTable() Method of the ITableRow Interface directly gets a ITableRelation Interface, so that you also have access to the combined fields there.
class DataRelationWrapper : ITableRelation { private DataRelation _dataRelation; public DataRelationWrapper(DataRelation dataRelation) { _dataRelation = dataRelation; } #region IDataRelation Members public string RelationName { get { return _dataRelation.RelationName; } } public string ParentColumnName { get { return _dataRelation.ParentColumns[0].ColumnName; } } public string ChildColumnName { get { return _dataRelation.ChildColumns[0].ColumnName; } } public string ParentTableName { get { return _dataRelation.ParentColumns[0].Table.TableName; } } public string ChildTableName { get { return _dataRelation.ChildColumns[0].Table.TableName; } } #endregion }
Class DataRelationWrapper Implements ITableRelation Private _dataRelation As DataRelation Public Sub New(dataRelation As DataRelation) _dataRelation = dataRelation End Sub #region IDataRelation Members Public Readonly Property RelationName() As String Get Return _dataRelation.RelationName End Get End Property Public Readonly Property ParentColumnName() As String Get Return _dataRelation.ParentColumns(0).ColumnName End Get End Property Public Readonly Property ChildColumnName() As String Get Return _dataRelation.ChildColumns(0).ColumnName End Get End Property Public Readonly Property ParentTableName() As String Get Return _dataRelation.ParentColumns(0).Table.TableName End Get End Property Public Readonly Property ChildTableName() As String Get Return _dataRelation.ChildColumns(0).Table.TableName End Get End Property #End Region End Class
Platforms: Windows 10 (Version 21H2 - 23H2), Windows 11 (21H2 - 22H2), Windows Server 2016 - 2022
.NET: .NET Framework 4.8, .NET 6, .NET 7, .NET 8