/// <summary> /// Adds a new column with the specified name to the grid /// </summary> /// <param name="name">The name associated with the new column</param> /// <param name="text">The text to be displayed in the column header</param> /// <param name="width">The width of the column</param> /// <param name="hAlign">The horizontal alignment of the text in the column header</param> /// <param name="value">Object containing data associated with the column header</param> /// <returns>The newly created column if successful, otherwise null</returns> public ActiveColumnHeader AddColumn(string name, string text, int width, HorizontalAlignment hAlign, object value) { ActiveColumnHeader newColumn = null; // Make sure that a column with this name doesn't already exist. if (this.Columns.ContainsKey(name)) throw new DuplicateColumnNameException(String.Format("{0} : A column with this name already exists", name)); // Column doesn't already exist so we can add it. newColumn = new ActiveColumnHeader(); if (newColumn != null) { newColumn.Name = name; newColumn.Text = text; newColumn.Width = width; newColumn.TextAlign = hAlign; newColumn.Tag = value; this.Columns.Add(newColumn); } return newColumn; }
/// <summary> /// Adds an existing ActiveColumnHeader to the collection /// </summary> /// <param name="value">The ActiveColumnHeader to add to the collection</param> /// <returns>The zero-based index into the collection where the item was added</returns> public int Add(ActiveColumnHeader value) { return base.Add(value); }
public ActiveGridItemComparer(ActiveColumnHeader columnHeader) { this._columnHeader = columnHeader; this._sortOrder = columnHeader.SortOrder; this._col = columnHeader.Index; }
/// <summary> /// Sets the initial drawing specifications of the cell prior to drawing for the first time. /// This only need to be called once when it is first drawn. /// </summary> private void SetDrawingOptions() { if (this._row != null && this._row.Grid != null && this._firstTime) { // Set the Column-level drawing options for the cell. // The values are defined in the Column Header object to which this cell belongs. this._column = this._row.Grid.Columns[this._row.SubItems.IndexOf(this)]; if (this._column != null) { this.fldHorizontalAlignment = this._column.CellHorizontalAlignment; this.fldVerticalAlignment = this._column.CellVerticalAlignment; this.Format = this._column.CellFormat; this.fldDisplayZeroValues = this._column.DisplayZeroValues; } // Set Grid-level drawing options for the cell. // The values are defined in the Grid object to which this cell belongs. if (this._isFlashed) this._style = this._row.Grid.UseFlashGradient ? CellStyle.Gradient : CellStyle.Plain; else this._style = this._row.Grid.UseGradient ? CellStyle.Gradient : CellStyle.Plain; // Set the Grid-level Flash settings. this.fldFlashForeColor = ActiveGrid.Paintbox.FlashForeColor; this.fldFlashBackColor = ActiveGrid.Paintbox.FlashBackgroundColor; this.fldFlashGradientStartColor = ActiveGrid.Paintbox.FlashGradientStartColor; this.fldFlashGradientEndColor = ActiveGrid.Paintbox.FlashGradientEndColor; this.fldFlashLinearGradientMode = ActiveGrid.Paintbox.FlashLinearGradientMode; // Set the background colour, taking into account the fact that the grid // may be using an alternating background. this.BackColor = this._row.AlternateRow ? ActiveGrid.Paintbox.AlternateBackgroundColor : ActiveGrid.Paintbox.NormalBackgroundColor; this._fader.StartColor = ActiveGrid.Paintbox.FlashBackgroundColor; this._fader.EndColor = this.BackColor; this._fader.TotalIterations = ActiveCellFader.DEFAULT_TOTAL_ITERATIONS; this._firstTime = false; } }
/// <summary> /// Inserts an existing column header into the collection at the specified index /// </summary> /// <param name="index">The zero-based index location where the column header is inserted</param> /// <param name="value">The ActiveColumnHeader to insert into the collection</param> public void Insert(int index, ActiveColumnHeader value) { base.Insert(index, value); }
/// <summary> /// Determines whether the specified column header is located in the collection. /// </summary> /// <param name="value"></param> /// <returns></returns> public bool Contains(ActiveColumnHeader value) { return base.Contains(value); }
/// <summary> /// Adds an array of column headers to the collection /// </summary> /// <param name="values">An array of ActiveColumnHeader objects to add to the collection</param> public void AddRange(ActiveColumnHeader[] values) { base.AddRange(values); }