private static void SetNestedParentRow(DataRow childRow, DataRow parentRow) { DataRelation rel = GetNestedParentRelation(childRow); //we should not set this row's parentRow if the table doesn't match. if (rel != null) { if (parentRow == null || rel.ParentKey.Table != parentRow.Table) childRow.SetParentRow(null, rel); else childRow.SetParentRow(parentRow, rel); } }
private void FillRelationship (DataRow row, DataRow childRow, XmlNode parentNode, XmlNode childNode) { for (int i = 0; i < childRow.Table.ParentRelations.Count; i++) { DataRelation rel = childRow.Table.ParentRelations [i]; if (rel.ParentTable == row.Table) { childRow.SetParentRow (row); break; } } CheckDescendantRelationship (childNode, childRow); }