/// <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> /// Removes the first occurrence of a specific object from the collection. /// </summary> /// <param name="group">The object to remove from the collection.</param> /// <returns>true if item is successfully removed; otherwise, false. This method also returns false if item was not found in the collection.</returns> public bool Remove(DataGridGroup group) { if (List.Contains(group)) { List.Remove(group); return(true); } return(false); }
/// <summary> /// Swaps the position between 2 groups in this collection. /// </summary> /// <param name="group1">The first DataGridGroup object to be swapped.</param> /// <param name="group2">The second DataGridGroup object to be swapped.</param> /// <returns>true, if the operation executed successfully, otherwise, false.</returns> internal bool swapGroup(DataGridGroup group1, DataGridGroup group2) { bool result = false; internalCalls = true; if (Contains(group1) && Contains(group2)) { result = true; int idx1 = List.IndexOf(group1); int idx2 = List.IndexOf(group2); List[idx1] = group2; List[idx2] = group1; if (GroupSwapped != null) { GroupSwapped(this, new EventArgs()); } } internalCalls = false; return(result); }
/// <summary> /// Returns the index within the collection of the specified group. /// </summary> /// <param name="item">A DataGridGroup object representing the group to locate in the collection.</param> /// <returns>The zero-based index where the group is located within the collection; otherwise, negative one (-1).</returns> public int IndexOf(DataGridGroup group) { return(List.IndexOf(group)); }
/// <summary> /// Moves a DataGridGroup object to the last position in this collection. /// </summary> /// <param name="group">A DataGridGroup object to be moved.</param> /// <returns>true, if the operation executed successfully, otherwise, false.</returns> internal bool moveLast(DataGridGroup group) { return(moveGroup(List.Count - 1, group)); }
/// <summary> /// Moves a DataGridGroup object to the first index in this collection. /// </summary> /// <param name="group">A DataGridGroup object to be moved.</param> /// <returns>true, if the operation executed successfully, otherwise, false.</returns> internal bool moveFirst(DataGridGroup group) { return(moveGroup(0, group)); }
/// <summary> /// Determines whether an element is in the collection. /// </summary> /// <param name="group">The object to locate in the collection.</param> /// <returns>true if group is found in the collection; otherwise, false</returns> public bool Contains(DataGridGroup group) { return(List.Contains(group)); }
public DataGridGroupSummarize(DataGridGroup owner) { _owner = owner; }
public DataGridGroupSummarize() { _owner = new DataGridGroup(); }
public DataGridGroupSummarizeCollection(DataGridGroup owner) : base() { _owner = owner; }