Note that there are some explanatory texts on larger screens.

plurals
  1. POdataGridViewCombobox Value not being saved on Navigator Save Button Click
    primarykey
    data
    text
    <p>This is a VB.NET winforms project, using EF. The ComboBox is bound to a seperate datasource which contains the colums tName and tNumber. TName is a brief description of that value and tNumber is the actual number that is saved in the Financial Table under column named transaction_type. Everything works flawlessly on the display of existing data that is in the Financial Table. </p> <p>The comboboxes for each item in the grid all show the correct description for the transaction_type. But when ever I change the value of any of the combo boxes and click the save button it does not save any value to the transaction_type. </p> <p>Any ideas why this might be? Any missing code I will add if required..</p> <p>The form_load event looks like this:</p> <pre><code> Private Sub paymentHistoryView_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load FinancialDataGridView.DataSource = db.financials.Where(Function(f) f.TenantId = tenentId).OrderBy(Function(f) f.transaction_date) TranstypeBindingSource.DataSource = db.transtypes.OrderBy(Function(f) f.tNumber) BindingNavigatorDeleteItem.Enabled = False End Sub </code></pre> <p>And the savebutton click event is as follows:</p> <pre><code>Private Sub FinancialBindingNavigatorSaveItem_Click(sender As System.Object, e As System.EventArgs) Handles FinancialBindingNavigatorSaveItem.Click db.SaveChanges() End Sub </code></pre> <p>The properties for the ComboBox are shown Below:</p> <p><img src="https://i.stack.imgur.com/MQyb9.png" alt="ComboBoxProperties"> </p> <p>It should be noted that all other changes to the datagrid are saved correctly when the save button is clicked... After further testing the value will actually save if the ComboBox is no longer selected. I guess a work around would be to focus on something else after the value of a comboBox is changed. If this seems like the best way how would I hook on SelectedIndexChanged event for comboBoxs in the datagridview???</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload