private void SetNestedParentRegion(XmlBoundElement childRowElem, XmlBoundElement parentRowElem)
{
DataRow childRow = childRowElem.Row;
if (parentRowElem == null)
{
SetNestedParentRow(childRow, null);
return;
}
DataRow parentRow = parentRowElem.Row;
Debug.Assert(parentRow != null);
// We should set it only if there is a nested relationship between this child and parent regions
DataRelation[] relations = childRow.Table.NestedParentRelations;
if (relations.Length != 0 && relations[0].ParentTable == parentRow.Table) // just backward compatable
{
SetNestedParentRow(childRow, parentRow);
}
else
{
SetNestedParentRow(childRow, null);
}
}