/// <summary> /// Adds a DataGridGroup to the list of groups specified by the available header name for a DataGrid. /// </summary> public DataGridGroup Add(string headerName) { foreach (DataGridGroup dg in List) { if (dg.Header.Name == headerName) { return(dg); } } DataGridHeader header = null; foreach (DataGridHeader dh in _owner._headers) { if (dh.Name == headerName) { header = dh; break; } } if (header != null) { DataGridGroup group = new DataGridGroup(_owner, header); int index = List.Add(group); return((DataGridGroup)List[index]); } return(null); }
/// <summary> /// Adds a DataGridGroup to the list of groups specified by the available header for a DataGrid. /// </summary> public DataGridGroup Add(DataGridHeader header) { foreach (DataGridGroup dg in List) { if (dg.Header == header) { return(dg); } } bool found = false; foreach (DataGridHeader dh in _owner._headers) { if (dh == header) { found = true; break; } } if (found) { DataGridGroup group = new DataGridGroup(_owner, header); int index = List.Add(group); return((DataGridGroup)List[index]); } return(null); }
/// <summary> /// Determines whether a data grid group that contains specified data grid header is in the collection. /// </summary> /// <param name="item">The object to locate in the collection.</param> /// <returns>true if item is found in the collection; otherwise, false</returns> public bool Contains(DataGridHeader header) { foreach (DataGridGroup dg in List) { if (dg.Header == header) { return(true); } } return(false); }
public DataGridGroup(DataGrid owner, DataGridHeader header) { _owner = owner; _header = header; _summarizes = new DataGridGroupSummarizeCollection(this); }