Example #1
0
 internal MatrixCell(MatrixDisplayColumn dc)
 {
     if (dc == null)
     {
         throw new ArgumentNullException("dc");
     }
     _dc          = dc;
     this.Visible = dc.Visible;
 }
Example #2
0
        /// <summary>
        /// Called when a new header value is added to the list by <see cref="MaybeAddHeaderValue"/> or by the page developer.
        /// Creates the corresponding <see cref="MatrixDisplayColumn"/> and adds them to <see cref="DisplayColumns"/>.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        /// <exception cref="NotImplementedException"></exception>
        private void dataHeaderValues_CollectionChanged(object sender, NotifyCollectionChangedEventArgs e)
        {
            switch (e.Action)
            {
            case NotifyCollectionChangedAction.Add:
                foreach (MatrixColumn col in this.MatrixColumns.Where(p => p.ColumnType == MatrixColumnType.CellValue))
                {
                    MatrixDisplayColumn dc = new MatrixDisplayColumn(this, col, e.NewStartingIndex);
                    _displayColumns.Add(dc);
                }
                break;

            default:
                throw new NotImplementedException();
            }
        }
Example #3
0
        /// <summary>
        /// Hook up the row data bound and pre render events of the grid
        /// </summary>
        /// <param name="sortingEnabled">Not used</param>
        /// <param name="control">This must be of type <see cref="GridViewEx"/>.</param>
        /// <returns></returns>
        public override bool Initialize(bool sortingEnabled, Control control)
        {
            _gv = (GridViewEx)control;

            if (this.MatrixColumns.Count == 0)
            {
                // Add a default column
                this.MatrixColumns.Add(new MatrixColumn());
            }

            foreach (var mc in this.MatrixColumns.Where(p => p.ColumnType == MatrixColumnType.RowTotal))
            {
                MatrixDisplayColumn info = new MatrixDisplayColumn(this, mc, -1);
                _displayColumns.Add(info);
            }

            return(base.Initialize(sortingEnabled, control));
        }