コード例 #1
0
ファイル: MarketDataViewRow.cs プロジェクト: smther/FreeOQ
		protected override DataGridViewCellCollection CreateCellsInstance()
		{
			DataGridViewCellCollection viewCellCollection = new DataGridViewCellCollection((DataGridViewRow)this);
			for (int index = 0; index < this.cellCount; ++index)
				viewCellCollection.Add((DataGridViewCell)new DataGridViewTextBoxCell());
			return viewCellCollection;
		}
コード例 #2
0
 public static void AddText(this DataGridViewCellCollection c, string text)
 {
     c.Add(
         new DataGridViewTextBoxCell {
         Value = text
     }
         );
 }
コード例 #3
0
        public void CreateCells(DataGridView dataGridView)
        {
            if (dataGridView == null)
            {
                throw new ArgumentNullException("DataGridView is null.");
            }
            if (dataGridView.Rows.Contains(this))
            {
                throw new InvalidOperationException("The row already exists in the DataGridView.");
            }
            DataGridViewCellCollection newCellCollection = new DataGridViewCellCollection(this);

            foreach (DataGridViewColumn column in dataGridView.Columns)
            {
                if (column.CellTemplate == null)
                {
                    throw new InvalidOperationException("Cell template not set in column: " + column.Index.ToString() + ".");
                }
                newCellCollection.Add((DataGridViewCell)column.CellTemplate.Clone());
            }
            cells = newCellCollection;
        }
コード例 #4
0
		public void CreateCells (DataGridView dataGridView)
		{
			if (dataGridView == null) {
				throw new ArgumentNullException("DataGridView is null.");
			}
			if (dataGridView.Rows.Contains(this)) {
				throw new InvalidOperationException("The row already exists in the DataGridView.");
			}
			DataGridViewCellCollection newCellCollection = new DataGridViewCellCollection(this);
			foreach (DataGridViewColumn column in dataGridView.Columns) {
				if (column.CellTemplate == null) {
					throw new InvalidOperationException("Cell template not set in column: " + column.Index.ToString() + ".");
				}
				newCellCollection.Add((DataGridViewCell) column.CellTemplate.Clone());
			}
			cells = newCellCollection;
		}