Exemplo n.º 1
0
 //
 // Create a new column - DisplayMember, ValueMember passed by string
 //
 public DataGridComboBoxColumn(DataTable DataSource, string DisplayMember, string ValueMember)
 {
     Combo               = new DataGridComboBox();
     Combo.Visible       = false;
     Combo.DataSource    = DataSource;
     Combo.DisplayMember = DisplayMember;
     Combo.ValueMember   = ValueMember;
     Combo.DropDownStyle = ComboBoxStyle.DropDownList;
 }
Exemplo n.º 2
0
        //
        // Create a new column - DisplayMember, ValueMember
        // Passed by ordinal

        public DataGridComboBoxColumn(DataTable DataSource, int DisplayMember, int ValueMember)
        {
            Combo          = new DataGridComboBox();
            _DisplayMember = DataSource.Columns[DisplayMember].ToString();
            _ValueMember   = DataSource.Columns[ValueMember].ToString();

            Combo.Visible       = false;
            Combo.DataSource    = DataSource;
            Combo.DisplayMember = _DisplayMember;
            Combo.ValueMember   = _ValueMember;
            Combo.DropDownStyle = ComboBoxStyle.DropDownList;
        }