コード例 #1
0
ファイル: MyDgvMcCB.cs プロジェクト: Camel-RD/Klons
        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);
        }
コード例 #2
0
ファイル: MyDgvMcCB.cs プロジェクト: Camel-RD/Klons
        /*
         * 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);
                    }
                }
            }
        }