Ejemplo n.º 1
0
        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";
        }
Ejemplo n.º 2
0
        private void CreateDataGridColumn()
        {
            dataGridBrokers.DataSource = null;
            this.dataGridBrokers.Rows.Clear();
            dataGridBrokers.AutoGenerateColumns = false;
            dataGridBrokers.ColumnCount         = 3;

            dataGridBrokers.Columns[0].HeaderText       = "Id";
            dataGridBrokers.Columns[0].Name             = "Id";
            dataGridBrokers.Columns[0].DataPropertyName = "Id";
            dataGridBrokers.Columns[0].Visible          = false;

            dataGridBrokers.Columns[1].HeaderText       = "Broker Code";
            dataGridBrokers.Columns[1].Name             = "BrokerCode";
            dataGridBrokers.Columns[1].DataPropertyName = "BrokerCode";

            dataGridBrokers.Columns[2].Name             = "Broker Description";
            dataGridBrokers.Columns[2].HeaderText       = "BrokerDescription";
            dataGridBrokers.Columns[2].DataPropertyName = "BrokerDescription";

            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;

            dataGridBrokers.Columns.AddRange(buttonColumn, buttonColumnEdit);
            dataGridBrokers.Columns[3].Width = 20;
            dataGridBrokers.Columns[4].Width = 30;
            var dataSource = instrumentMapping.GetBrokers();

            dataGridBrokers.DataSource = dataSource;
        }