private void ResolveAllColumns(GridGroupColumn column) { if (column.Columns.Count > 0) { foreach (GridColumn subColumn in column.Columns) { _allColumns.Add(subColumn); } } else if (column.GroupColumns.Count > 0) { foreach (GridGroupColumn subColumn in column.GroupColumns) { ResolveAllColumns(subColumn); } } }
// 递归获得每个分组头中包含的列数 private void ResolveColumnCount(GridGroupColumn group, ref int columnCount) { if (group.Columns.Count > 0) { columnCount += group.Columns.Count; } else if (group.GroupColumns.Count > 0) { foreach (GridGroupColumn subGroup in group.GroupColumns) { ResolveColumnCount(subGroup, ref columnCount); } } }
private Grid ResolveParentGrid(GridGroupColumn groupColumn) { if (groupColumn != null) { if (groupColumn.Parent is Grid) { return (Grid)groupColumn.Parent; } else { return ResolveParentGrid(groupColumn.Parent as GridGroupColumn); } } else { return null; } }