internal bool MoveToFirstChild()
{
RealFoliate();
AssertValid();
if (_node == null)
return false;
if (_column != null)
{
if (_column.ColumnMapping == MappingType.Attribute || _column.ColumnMapping == MappingType.Hidden)
return false;
if (_fOnValue) //text node has no children to move to
return false;
_fOnValue = true;
return true;
}
if (!IsFoliated(_node))
{
// find virtual column elements first
DataRow curRow = Row;
DataColumn c = NextColumn(curRow, null, false);
while (c != null)
{
if (IsValidChild(_node, c))
{
MoveTo(_node, c, _doc.IsTextOnly(c));
return true;
}
c = NextColumn(curRow, c, false);
}
}
// look for anything
XmlNode n = _doc.SafeFirstChild(_node);
while (n != null)
{
if (IsValidChild(_node, n))
{
MoveTo(n);
return true;
}
n = _doc.SafeNextSibling(n);
}
return false;
}