I have this form that allows the user to select an item (code - product) from comboxbox. enter quantity and price and add it to the list.

Loading inventory in the form
private List<Inventory> inventories = new Inventory().read_inventory();
Configuring ComboBox with Values
private void set_drop_down_inventory() { cb_inventory.DisplayMember = "name"; cb_inventory.DataSource = inventories; cb_inventory.ResetText(); cb_inventory.SelectedIndex = -1; }
When the user selects a product, he will create a new instance.
private void cb_inventory_SelectionChangeCommitted(object sender, EventArgs e) { var selected_inventory = (cb_inventory.SelectedItem as Inventory); sales_order_detail = new Sales_Order_Detail(selected_inventory, 0); tx_description.Text = selected_inventory.description; tx_price.Text = selected_inventory.get_price_str(); }
As soon as the user adds an item, he calls this code.
private void btn_add_item_Click(object sender, EventArgs e) {
This is how I initialize the datagrid because I need to manually display the columns - this is where I am not sure what to do - I believe that I do not need to manually add a new row every time the user adds an item because this datagrid is limited to List <>, so any instance is added to List <> it will be added to the grid when I run dgv.Refresh ()
private void initialize_datagrid(Sales_Order_Detail sales_order_detail) { dgv_sales_order_details.Columns.Clear(); dgv_sales_order_details.DataSource = null; dgv_sales_order_details.Refresh(); dgv_sales_order_details.AutoGenerateColumns = false; // Set the datasource to the list where the item is added dgv_sales_order_details.DataSource = sales_order.sales_order_details; DataGridViewComboBoxColumn product_code_col = new DataGridViewComboBoxColumn(); DataGridViewColumn description_col = new DataGridViewColumn(); DataGridViewColumn quantity_col = new DataGridViewColumn(); DataGridViewColumn price_col = new DataGridViewColumn(); DataGridViewColumn account_col = new DataGridViewColumn(); DataGridViewComboBoxCell product_cell = new DataGridViewComboBoxCell(); DataGridViewTextBoxCell description_cell = new DataGridViewTextBoxCell(); DataGridViewTextBoxCell amount_cell = new DataGridViewTextBoxCell(); product_cell.DisplayMember = "name"; // They have the same Datasource as the combobox above. product_cell.DataSource = inventories; product_code_col.CellTemplate = product_cell; product_code_col.DataPropertyName = nameof(sales_order_detail.inventory.name); //This binds the value to your column product_code_col.HeaderText = "Code"; product_code_col.Name = "name"; description_col.CellTemplate = description_cell; description_col.DataPropertyName = nameof(sales_order_detail.description); description_col.HeaderText = "Description"; description_col.Name = "description"; quantity_col.CellTemplate = amount_cell; quantity_col.DataPropertyName = nameof(sales_order_detail.quantity); quantity_col.HeaderText = "Quantity"; quantity_col.Name = "quantity"; quantity_col.DefaultCellStyle.Format = "0.00"; quantity_col.DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight; price_col.CellTemplate = amount_cell; price_col.DataPropertyName = nameof(sales_order_detail.price); price_col.HeaderText = "Price"; price_col.Name = "price"; price_col.DefaultCellStyle.Format = "0.00"; price_col.DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight; dgv_sales_order_details.Columns.Add(product_code_col); dgv_sales_order_details.Columns.Add(description_col); dgv_sales_order_details.Columns.Add(quantity_col); dgv_sales_order_details.Columns.Add(price_col); dgv_sales_order_details.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill; }
This is the result when the item is added, but since you can see that the combobox column does not display the value, it only displays the value when I click the combobox column. and when I change the value in the dropdown above the list, the value in the combobox column also changes. they seem to be attached.

My goal is to add a row to the datagrid where the comboboxcolumn displays what I have selected and fix the duplicate combo box selection.
Please comment if this requires clarification so that I can fix it. Thanks!