public override object Clone() { MyDgvMcCBCell cell = (MyDgvMcCBCell)base.Clone(); cell.ColumnNames = this.ColumnNames; cell.ColumnWidths = this.ColumnWidths; cell.DropDownWidth = this.DropDownWidth; //cell.ResizeColumns(10.0f); cell.MaxDropDownItems = this.MaxDropDownItems; cell.DropDownStyle = this.DropDownStyle; cell.DataSource = this.DataSource; cell.ItemStrings = this.ItemStrings; cell.DisplayMember = this.DisplayMember; cell.ValueMember = this.ValueMember; cell.LimitToList = this.LimitToList; return(cell); }
/* * public void ResizeColumns(float basefontsize) * { * this.ComboBoxCellTemplateA.ResizeColumns(basefontsize); * if (base.DataGridView != null) * { * DataGridViewRowCollection rows = base.DataGridView.Rows; * int count = rows.Count; * for (int i = 0; i < count; i++) * { * MyDgvMcCBCell cell = rows.SharedRow(i).Cells[base.Index] as MyDgvMcCBCell; * if (cell != null) * { * cell.ResizeColumns(basefontsize); * } * } * } * } */ public void ScaleColumn(SizeF factor) { this.ComboBoxCellTemplateA.ScaleColumn(factor); if (base.DataGridView != null) { DataGridViewRowCollection rows = base.DataGridView.Rows; int count = rows.Count; for (int i = 0; i < count; i++) { MyDgvMcCBCell cell = rows.SharedRow(i).Cells[base.Index] as MyDgvMcCBCell; if (cell != null) { cell.ScaleColumn(factor); } } } }