private void BindComboBox() { InstrumentList = instrumentMapping.GetInstruments(); brokerList = instrumentMapping.GetBrokers(); comboBroker.DataSource = brokerList; comboBroker.DisplayMember = "BrokerCode"; comboBroker.ValueMember = "Id"; comboInstrument.DataSource = InstrumentList; comboInstrument.DisplayMember = "InstrumentCode"; comboInstrument.ValueMember = "Id"; }
private void CreateDataGridColumn() { dataGridInstruments.DataSource = null; this.dataGridInstruments.Rows.Clear(); dataGridInstruments.AutoGenerateColumns = false; dataGridInstruments.ColumnCount = 3; dataGridInstruments.Columns[0].HeaderText = "Id"; dataGridInstruments.Columns[0].Name = "Id"; dataGridInstruments.Columns[0].DataPropertyName = "Id"; dataGridInstruments.Columns[0].Visible = false; dataGridInstruments.Columns[1].HeaderText = "Instrument Code"; dataGridInstruments.Columns[1].Name = "InstrumentCode"; dataGridInstruments.Columns[1].DataPropertyName = "InstrumentCode"; dataGridInstruments.Columns[2].Name = "Instrument Description"; dataGridInstruments.Columns[2].HeaderText = "InstrumentDescription"; dataGridInstruments.Columns[2].DataPropertyName = "InstrumentDescription"; buttonColumn.HeaderText = ""; buttonColumn.Name = "buttonColumn"; Image image = ELEVEN.Properties.Resources.Delete; buttonColumn.Image = image; buttonColumn.Width = 15; buttonColumnEdit.HeaderText = ""; buttonColumnEdit.Name = "buttonColumnEdit"; Image imageEdit = ELEVEN.Properties.Resources.app_edit; buttonColumnEdit.Image = imageEdit; buttonColumnEdit.Width = 15; dataGridInstruments.Columns.AddRange(buttonColumn, buttonColumnEdit); dataGridInstruments.Columns[3].Width = 20; dataGridInstruments.Columns[4].Width = 30; var dataSource = instrumentMapping.GetInstruments(); dataGridInstruments.DataSource = dataSource; }