private string GetNamespace(XmlBoundElement be, string name)
{
if (be == null)
return null;
XmlAttribute attr = null;
if (be.IsFoliated)
{
attr = be.GetAttributeNode(name, StrReservedXmlns);
if (attr != null)
return attr.Value;
else
return null;
}
else
{ //defoliated so that we need to search through its column
DataRow curRow = be.Row;
if (curRow == null)
return null;
//going through its attribute columns
DataColumn curCol = PreviousColumn(curRow, null, true);
while (curCol != null)
{
if (curCol.Namespace == StrReservedXmlns)
{
DataRowVersion rowVersion = (curRow.RowState == DataRowState.Detached) ? DataRowVersion.Proposed : DataRowVersion.Current;
return curCol.ConvertObjectToXml(curRow[curCol, rowVersion]);
}
curCol = PreviousColumn(curRow, curCol, true);
}
return null;
}
}