Ejemplo n.º 1
0
        /// <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);
        }
Ejemplo n.º 2
0
        /// <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);
        }
Ejemplo n.º 3
0
 /// <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);
 }
Ejemplo n.º 4
0
 public DataGridGroup(DataGrid owner, DataGridHeader header) {
     _owner = owner;
     _header = header;
     _summarizes = new DataGridGroupSummarizeCollection(this);
 }