Example #1
0
        private void CreateColumns()
        {
            //SQL Server Data Type column
            DataGridViewTextBoxColumn dgvcolSqlServerDataTypeColumn = new DataGridViewTextBoxColumn();

            dgvcolSqlServerDataTypeColumn.Name             = "sqlServerDataTypeColumn";
            dgvcolSqlServerDataTypeColumn.HeaderText       = "SQL Server Data Type";
            dgvcolSqlServerDataTypeColumn.AutoSizeMode     = DataGridViewAutoSizeColumnMode.Fill;
            dgvcolSqlServerDataTypeColumn.DataPropertyName = "DbDataTypeName";
            dgvcolSqlServerDataTypeColumn.ReadOnly         = true;

            dgvTypes.Columns.Add(dgvcolSqlServerDataTypeColumn);

            //.Net Data Type Column
            DataGridViewComboBoxColumn dgvcolDotNetDataType = new DataGridViewComboBoxColumn();

            dgvcolDotNetDataType.Name             = "dotNetDataType";
            dgvcolDotNetDataType.HeaderText       = ".Net Data Type";
            dgvcolDotNetDataType.AutoSizeMode     = DataGridViewAutoSizeColumnMode.Fill;
            dgvcolDotNetDataType.DataPropertyName = "DotNetDataTypeName";

            dgvcolDotNetDataType.DataSource = _dataTypeService.GetAllDotNetDataTypes().ToList();

            dgvTypes.Columns.Add(dgvcolDotNetDataType);
        }