本文整理汇总了C#中System.Windows.Forms.DataGridViewComboBoxColumn类的典型用法代码示例。如果您正苦于以下问题:C# DataGridViewComboBoxColumn类的具体用法?C# DataGridViewComboBoxColumn怎么用?C# DataGridViewComboBoxColumn使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
DataGridViewComboBoxColumn类属于System.Windows.Forms命名空间,在下文中一共展示了DataGridViewComboBoxColumn类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: HienThiDataGridViewComboBoxColumn
public void HienThiDataGridViewComboBoxColumn(DataGridViewComboBoxColumn cmbColumn)
{
cmbColumn.DataSource = m_KhoanChiData.LayDsKhoanChi("SELECT MaKC, TenKC FROM KhoanChi");
cmbColumn.DisplayMember = "TenKC";
cmbColumn.ValueMember = "MaKC";
cmbColumn.DataPropertyName = "MaKC";
}
开发者ID:hieu292,项目名称:ngocminh,代码行数:7,代码来源:KhoanChiCtrl.cs
示例2: GetAppointmentIDsAndTests
private void GetAppointmentIDsAndTests()
{
this.Clear();
DataGridViewComboBoxColumn cmb = new DataGridViewComboBoxColumn();
cmb.HeaderText = "Select Test";
ComboBox cbTests = new ComboBox();
foreach (LabTest test in testList)
{
cmb.Items.Add(test.TestType);
}
dgvAddTest.Columns.Add(cmb);
//cbAppointmentID.SelectedIndexChanged -= cbAppointmentID_SelectedIndexChanged;
//cbAppointmentID.DataSource = null;
//cbAppointmentID.Items.Clear();
//cbAppointmentID.SelectedIndexChanged += cbAppointmentID_SelectedIndexChanged;
//appointmentsList = AppointmentController.GetAppointmentsWithoutDiagnosis();
//cbAppointmentID.DataSource = appointmentsList;
//cbAppointmentID.DisplayMember = "AppointmentID";
//cbAppointmentID.ValueMember = "AppointmentID";
//cbTest.SelectedIndexChanged -= cbTest_SelectedIndexChanged;
//cbTest.DataSource = null;
//cbTest.Items.Clear();
//cbTest.SelectedIndexChanged += cbTest_SelectedIndexChanged;
//testList = LabTestController.GetAllLabTests();
//cbTest.DataSource = testList;
//cbTest.DisplayMember = "TestType";
//cbTest.ValueMember = "TestId";
}
开发者ID:mwilian,项目名称:healthcaresystem,代码行数:35,代码来源:frmAddTest.cs
示例3: EditDefaultFindings
private string sql = "SELECT exam_type, findings FROM default_findings ORDER BY exam_type"; //●●●移植時要変更
#endregion Fields
#region Constructors
public EditDefaultFindings()
{
InitializeComponent();
//this.dgv.RowHeadersVisible = false;
this.dgv.MultiSelect = false;
this.dgv.Font = new Font(dgv.Font.Name, 12);
this.dgv.AutoSizeRowsMode = DataGridViewAutoSizeRowsMode.AllCells;
this.dgv.DataSource = dt;
showList();
//●●●移植時要変更
dgv.Columns["exam_type"].Visible = false;
dgv.Columns["findings"].HeaderText = Properties.Resources.Findings;
dgv.Columns["findings"].DataGridView.DefaultCellStyle.WrapMode = DataGridViewTriState.True;
DataGridViewComboBoxColumn eTypeColumn = new DataGridViewComboBoxColumn();
eTypeColumn.DataPropertyName = "exam_type"; //バインドされているデータを表示する
eTypeColumn.DataSource = CLocalDB.localDB.Tables["all_exam_type"];
eTypeColumn.ValueMember = "type_no";
eTypeColumn.DisplayMember = "exam_name";
eTypeColumn.HeaderText = Properties.Resources.ExamType;
this.dgv.Columns.Add(eTypeColumn);
this.dgv.Columns[1].DisplayIndex = 1;
this.dgv.Columns[2].DisplayIndex = 0;
dgv.Columns[2].ReadOnly = true;
resizeColumns();
}
开发者ID:KoichiHirahata,项目名称:FindingsEditor,代码行数:36,代码来源:EditDefaultFindings.cs
示例4: CreateColumn
public static DataGridViewColumn CreateColumn( DataGridViewColumnType columnType, String columnName, String columnText)
{
DataGridViewColumn col = null;
switch (columnType)
{
case DataGridViewColumnType.MULTICOMBOBOX:
col = new DataGridViewMultiColumnComboBoxColumn();
break;
case DataGridViewColumnType.COMBOBOX:
col = new DataGridViewComboBoxColumn();
break;
case DataGridViewColumnType.TIME:
col = new DataGridViewTimeColumn();
break;
case DataGridViewColumnType.DATE:
col = new DataGridViewDateTimeColumn();
break;
case DataGridViewColumnType.CHECKBOX:
col = new DataGridViewCheckBoxColumn();
break;
case DataGridViewColumnType.NUMBER:
default:
col = new DataGridViewTextBoxColumn();
break;
}
col.DataPropertyName = columnName;
col.Name = columnName;
col.HeaderText = columnText;
return col;
}
开发者ID:anthanhcong,项目名称:atc-demand-instruction-form,代码行数:30,代码来源:DataGridViewHelper.cs
示例5: Form1_Load
private void Form1_Load(object sender, EventArgs e)
{
_dg1 = new DataGridView();
_dg1.AutoSize = true;
_bsSites = new BindingSource();
_bsSites.DataSource = _availableWebSites;
_bs1 = new BindingSource();
_bs1.DataSource = _toBeUpdatedList;
_dg1.DataSource = _bs1;
this.Controls.Add(_dg1);
_dg1.Columns["WebSiteName"].Visible = false;
_dg1.Columns["VDir"].Visible = false;
_dg1.Columns["WebSiteId"].Visible = false;
DataGridViewComboBoxColumn columnSites = new DataGridViewComboBoxColumn();
columnSites.DataPropertyName = "WebSiteId";
columnSites.HeaderText = "Available Sites";
columnSites.Width = 120;
columnSites.DataSource = _bsSites;
columnSites.ValueMember = "WebSiteId";
columnSites.DisplayMember = "WebSiteName";
_dg1.Columns.Add(columnSites);
}
开发者ID:rodchar,项目名称:csgen,代码行数:26,代码来源:Form1.cs
示例6: SetupDataGridViewColumns
private void SetupDataGridViewColumns()
{
dataGridView1.AutoGenerateColumns = false;
var queryColumn = new DataGridViewComboBoxColumn();
var columnChoices = GetQueryFieldChoices();
queryColumn.Name = "Name";
queryColumn.HeaderText = "Name";
queryColumn.DataSource = columnChoices;
queryColumn.DisplayMember = "Display";
queryColumn.ValueMember = "Value";
queryColumn.DataPropertyName = "Name";
queryColumn.Width = 150;
dataGridView1.Columns.Add(queryColumn);
queryColumn = new DataGridViewComboBoxColumn();
columnChoices = GetOperatorFieldChoices();
queryColumn.Name = "Operator";
queryColumn.HeaderText = "Operator";
queryColumn.DataSource = columnChoices;
queryColumn.DisplayMember = "Display";
queryColumn.ValueMember = "Value";
queryColumn.DataPropertyName = "Type";
queryColumn.Width = 175;
dataGridView1.Columns.Add(queryColumn);
var valueColumn = new DataGridViewQueryValueColumn();
valueColumn.Name = "Value";
valueColumn.HeaderText = "Value";
valueColumn.DataPropertyName = "Value";
valueColumn.DefaultCellStyle.DataSourceNullValue = null;
//valueColumn.Width = 200;
valueColumn.AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
dataGridView1.Columns.Add(valueColumn);
}
开发者ID:harlam357,项目名称:hfm-net,代码行数:35,代码来源:QueryDialog.cs
示例7: ListColumn_Load
private void ListColumn_Load(object sender, EventArgs e)
{
DataSet ds = Program.StoreDB.GetCategoriesAndProducts();
dataGridView1.DataSource = ds.Tables["Products"];
// Remove the auto-generated CategoryID column.
dataGridView1.Columns.Remove("CategoryID");
// Create a list column for the CategoryID.
DataGridViewComboBoxColumn listCol = new DataGridViewComboBoxColumn();
listCol.DisplayIndex = 0;
listCol.HeaderText = "Category";
// This column is bound to the Products.CategoryID field.
listCol.DataPropertyName = "CategoryID";
// The list is filled from the Categories table.
listCol.DataSource = ds.Tables["Categories"];
listCol.DisplayMember = "CategoryName";
listCol.ValueMember = "CategoryID";
// Add the column.
dataGridView1.Columns.Add(listCol);
}
开发者ID:ehershey,项目名称:development,代码行数:25,代码来源:ListColumn.cs
示例8: fillTrainingBags
private void fillTrainingBags()
{
DataGridViewColumn dgvIndex = new DataGridViewTextBoxColumn();
{
dgvIndex.HeaderText = "Slot";
dgvIndex.DisplayIndex = 0;
dgvIndex.Width = 25;
dgvIndex.ReadOnly = true;
dgvIndex.DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter;
}
DataGridViewComboBoxColumn dgvBag = new DataGridViewComboBoxColumn
{
DisplayStyle = DataGridViewComboBoxDisplayStyle.Nothing
};
{
foreach (string t in trba)
if (t.Length > 0)
dgvBag.Items.Add(t);
dgvBag.DisplayIndex = 1;
dgvBag.Width = 135;
dgvBag.FlatStyle = FlatStyle.Flat;
}
dataGridView1.Columns.Add(dgvIndex);
dataGridView1.Columns.Add(dgvBag);
dataGridView1.Rows.Add(12);
int offset = Main.SAV.SuperTrain + 0x308;
for (int i = 0; i < 12; i++)
{
dataGridView1.Rows[i].Cells[0].Value = (i + 1).ToString();
dataGridView1.Rows[i].Cells[1].Value = trba[sav[offset + i]];
}
}
开发者ID:Bluestar012,项目名称:PKHeX,代码行数:34,代码来源:SAV_SuperTrain.cs
示例9: BindGrid
private void BindGrid()
{
try
{
Dictionary<string, ServiceControllerStatus> availableService = proxy.GetAvailableServices(sessionID);
dataGridView_Services.Rows.Clear();
DataGridViewRow row = null;
DataGridViewComboBoxColumn comboboxColumn = new DataGridViewComboBoxColumn();
//int rowCount;
if (availableService != null)
{
foreach (string service in availableService.Keys)
{
row = dataGridView_Services.Rows[dataGridView_Services.Rows.Add()];
row.Cells["serviceName"].Value = service;
row.Cells["serviceStatus"].Value = availableService[service].ToString();
row.Cells["serviceAction"].Value = "START";
}
}
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
开发者ID:TheProjecter,项目名称:processmemoryanalyzer,代码行数:25,代码来源:PanelServicesHandler.cs
示例10: AddStateColoumn
private void AddStateColoumn()
{
//originalTable.Columns.Add("State");
stateComboBox = new DataGridViewComboBoxColumn();
stateComboBox.HeaderText = "وضعیت";
stateComboBox.Name = "StateComboBox";
stateComboBox.MaxDropDownItems = 4;
stateComboBox.Items.Add("در حال پرواز");
stateComboBox.Items.Add("با تاخیر");
stateComboBox.Items.Add("طبق قرار");
stateComboBox.Items.Add("رسیده");
FlightGridView.Columns.Add(stateComboBox);
FlightGridView.Columns["OriginCountry"].HeaderText = "کشور مبدا";
FlightGridView.Columns["OriginCity"].HeaderText = "شهر مبدا";
FlightGridView.Columns["OriginAirport"].HeaderText = "فرودگاه مبدا";
FlightGridView.Columns["DestinationCountry"].HeaderText = "کشور مقصد";
FlightGridView.Columns["DestinationCity"].HeaderText = "شهر مقصد";
FlightGridView.Columns["DestinationAirport"].HeaderText = "مقصد";
FlightGridView.Columns["DepartureDate"].HeaderText = "زمان پرواز";
FlightGridView.Columns["ArrivalDate"].HeaderText = "زمان فرود";
FlightGridView.Columns["ActualDepartureDate"].HeaderText = "زمان پرواز واقعی";
FlightGridView.Columns["ActualArrivalDate"].HeaderText = "زمان فرود واقعی";
FlightGridView.Columns["Plane"].HeaderText = "هواپیما";
FlightGridView.Columns["Cost"].HeaderText = "هزینه";
UpdateStateColumn();
}
开发者ID:jahandideh-iman,项目名称:Airport-Reservation-System,代码行数:29,代码来源:DisplayFlightsPage.cs
示例11: ProcsSelect
public ProcsSelect()
{
InitializeComponent();
DataTable data = db.FetchAllSql("SELECT MAX(uin) FROM data");
try
{
uin = Convert.ToInt32(data.Rows[0][0]) + 1;
}
catch (Exception) { }
data = db.FetchAllSql("SELECT id,title,time_h,time_m,time_s FROM proc");
int i = 0;
foreach (DataRow dr in data.Rows)
{
this.comboB.Items.Add("(" + toTim(dr[2].ToString()) + ":" + toTim(dr[3].ToString()) + ":" + toTim(dr[4].ToString()) + ") " + dr[1]);
dataUIN.Add(Convert.ToString(dr[0]));
i++;
}
DataGridViewComboBoxColumn cmb = new DataGridViewComboBoxColumn();
cmb.HeaderText = "Поряд.";
cmb.Name = "cmb";
cmb.Width = 50;
for (int j = 1; j < 20; j++)
cmb.Items.Add(j.ToString());
dataG.Columns.Add(cmb);
dataG.ReadOnly = true;
dataG.DefaultCellStyle.ForeColor = Color.Gray;
}
开发者ID:tatar1nro,项目名称:KKM_Trash,代码行数:35,代码来源:ProcsSelect.cs
示例12: SetupDataGridViewColumns
private void SetupDataGridViewColumns()
{
using (var col = new DataGridViewTextBoxColumn())
{
col.DataPropertyName = "Name";
col.HeaderText = "Name";
dgvNameEntries.Columns.Add(col);
col.AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
}
using (var col = new DataGridViewComboBoxColumn())
{
col.DataPropertyName = "NamePosition";
col.HeaderText = "Name Position";
col.DataSource = Enum.GetValues(typeof(NamePosition));
col.AutoSizeMode = DataGridViewAutoSizeColumnMode.DisplayedCells;
dgvNameEntries.Columns.Add(col);
}
using (var col = new DataGridViewCheckBoxColumn())
{
col.DataPropertyName = "IsFemale";
col.HeaderText = "Is Female";
col.FalseValue = false;
col.TrueValue = true;
col.AutoSizeMode = DataGridViewAutoSizeColumnMode.ColumnHeader;
dgvNameEntries.Columns.Add(col);
}
}
开发者ID:EterniaLogic,项目名称:Pulsar4x,代码行数:27,代码来源:CommanderNameThemesDialog.cs
示例13: InitTodoMarkersGridView
private void InitTodoMarkersGridView(IList<ToDoMarker> markers)
{
TodoMarkersGridView.AutoGenerateColumns = false;
TodoMarkersGridView.Columns.Clear();
TodoMarkersGridView.DataSource = new BindingList<ToDoMarker>(markers);
TodoMarkersGridView.AlternatingRowsDefaultCellStyle.BackColor = Color.Lavender;
TodoMarkersGridView.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
TodoMarkersGridView.CellValueChanged += SelectedPriorityChanged;
TodoMarkersGridView.ColumnHeaderMouseClick += SortColumn;
var markerTextColumn = new DataGridViewTextBoxColumn
{
Name = "Text",
DataPropertyName = "Text",
HeaderText = RubberduckUI.TodoSettings_Text,
ReadOnly = true
};
var markerPriorityColumn = new DataGridViewComboBoxColumn
{
Name = "Priority",
DataSource = TodoLabels(),
AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill,
HeaderText = RubberduckUI.TodoSettings_Priority,
DataPropertyName = "PriorityLabel",
};
TodoMarkersGridView.Columns.AddRange(markerTextColumn, markerPriorityColumn);
}
开发者ID:ThunderFrame,项目名称:Rubberduck,代码行数:29,代码来源:TodoListSettingsUserControl.cs
示例14: btnLoad_Click
private void btnLoad_Click(object sender, EventArgs e)
{
grdTickets.DataSource = manager.GetTicketsDataSet();
grdTickets.DataMember = "tblTickets";
DataGridViewTextBoxColumn clmId = new DataGridViewTextBoxColumn();
clmId.Name = "IdColumn";
clmId.DataPropertyName = "Id";
DataGridViewTextBoxColumn clmAccountId = new DataGridViewTextBoxColumn();
clmAccountId.Name = "AccountIdColumn";
clmAccountId.DataPropertyName = "AccountId";
DataGridViewTextBoxColumn clmDateOpened = new DataGridViewTextBoxColumn();
clmDateOpened.Name = "DateOpenedColumn";
clmDateOpened.DataPropertyName = "DateOpened";
DataGridViewComboBoxColumn clmState = new DataGridViewComboBoxColumn();
clmState.Name = "StateColumn";
clmState.DataPropertyName = "State";
clmState.DataSource = GetStates() ;
clmState.DisplayMember ="Name" ;
clmState.ValueMember="Value";
grdTickets.Columns.Clear();
grdTickets.Columns.Add(clmId);
grdTickets.Columns.Add(clmAccountId);
grdTickets.Columns.Add(clmDateOpened);
grdTickets.Columns.Add(clmState);
}
开发者ID:AdriVanHoudt,项目名称:School,代码行数:31,代码来源:Form1.cs
示例15: InitUI
private void InitUI()
{
this.passwordAttributesDGV.RowHeadersVisible = true;
this.passwordAttributesDGV.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
this.passwordAttributesDGV.MultiSelect = false;
this.passwordAttributesDGV.AllowUserToAddRows = true;
this.passwordAttributesDGV.Columns.Add(new DataGridViewTextBoxColumn()
{
Name = "Attribute Name",
DataPropertyName = "Name",
HeaderText = "Attribute Name",
AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill,
ReadOnly = false
});
DataGridViewComboBoxColumn combCol = new DataGridViewComboBoxColumn()
{
Name = "Hash Method",
DataPropertyName = "HashMethod",
HeaderText = "Hash Method",
AutoSizeMode = DataGridViewAutoSizeColumnMode.None,
Width = 250,
DisplayMember = "Name",
ValueMember = "Method",
};
this.passwordAttributesDGV.DefaultValuesNeeded += passwordAttributesDGV_DefaultValuesNeeded;
combCol.Items.AddRange(PasswordHashMethod.methods.Values.ToArray());
this.passwordAttributesDGV.Columns.Add(combCol);
m_encryptionMethodCb.Items.Add("No Encryption"); // Settings.EncryptionMethod.NO_ENCRYPTION
m_encryptionMethodCb.Items.Add("SSL (ldaps://)"); // Settings.EncryptionMethod.TLS_SSL
m_encryptionMethodCb.Items.Add("StartTLS"); // Settings.EncryptionMethod.START_TLS
}
开发者ID:rafu1,项目名称:pgina,代码行数:33,代码来源:Configuration.cs
示例16: button1_Click
private void button1_Click(object sender, EventArgs e)
{
#region 生成DataGridView列 并设置
{
DataGridViewComboBoxColumn col = new DataGridViewComboBoxColumn();
col.HeaderText = "城市名称";
col.Name = "城市名称";
col.DataSource = DBMaker.GetCity();
col.DisplayMember = "txtName";
col.ValueMember = "Id";
dgv1.Columns.Add(col);
}
#endregion
#region 填充DataGridViewComboBoxColumn
{
DataGridViewComboBoxColumn col = dgv1.Columns[0] as DataGridViewComboBoxColumn;
col.HeaderText = "城市名称";
col.Name = "城市名称";
col.DataSource = DBMaker.GetCity();
col.DisplayMember = "txtName";
col.ValueMember = "Id";
}
#endregion
}
开发者ID:henrydem,项目名称:yongfa365doc,代码行数:25,代码来源:FrmDataGridView.cs
示例17: HienThiDataGridViewComboBoxColumn
public void HienThiDataGridViewComboBoxColumn(DataGridViewComboBoxColumn cmbComlumn)
{
cmbComlumn.DataSource = m_PhanBanData.LayDSBan();
cmbComlumn.DisplayMember = "TenBan";
cmbComlumn.ValueMember = "MaBan";
cmbComlumn.DataPropertyName = "MaBan";
cmbComlumn.HeaderText = "Tên Ban";
}
开发者ID:pthdnq,项目名称:csharp-project-nduang,代码行数:8,代码来源:PhanBanCtrl.cs
示例18: HienThiDataGridViewComboBoxColumn
public void HienThiDataGridViewComboBoxColumn(DataGridViewComboBoxColumn cmbColumn)
{
cmbColumn.DataSource = m_LoaiNguoiDungData.LayDsLoaiNguoiDung();
cmbColumn.DisplayMember = "TenLoaiNguoiDung";
cmbColumn.ValueMember = "MaLoaiNguoiDung";
cmbColumn.DataPropertyName = "MaLoaiNguoiDung";
cmbColumn.HeaderText = "Nhóm người dùng";
}
开发者ID:hieu292,项目名称:ngocminh,代码行数:8,代码来源:LoaiNguoiDungCtrl.cs
示例19: HienThiDataGridViewComboBoxColumn
public void HienThiDataGridViewComboBoxColumn(DataGridViewComboBoxColumn cmbColumn)
{
cmbColumn.DataSource = m_NhaCungCapData.LayDsNhaCungCap("SELECT MaNCC, TenNCC FROM NhaCungCap");
cmbColumn.DisplayMember = "TenNCC";
cmbColumn.ValueMember = "MaNCC";
cmbColumn.DataPropertyName = "MaNCC";
//cmbColumn.HeaderText = "Giáo viên";
}
开发者ID:hieu292,项目名称:ngocminh,代码行数:8,代码来源:NhaCungCapCtrl.cs
示例20: HienThiDataGridViewComboBoxColumn
public void HienThiDataGridViewComboBoxColumn(DataGridViewComboBoxColumn cmbColumn)
{
cmbColumn.DataSource = m_KhachHangData.LayDsKhachHang("SELECT MaKH, TenKH FROM KhachHang");
cmbColumn.DisplayMember = "TenKH";
cmbColumn.ValueMember = "MaKH";
cmbColumn.DataPropertyName = "MaKH";
//cmbColumn.HeaderText = "Giáo viên";
}
开发者ID:hieu292,项目名称:ngocminh,代码行数:8,代码来源:KhachHangCtrl.cs
注:本文中的System.Windows.Forms.DataGridViewComboBoxColumn类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论