Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8600023
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T01:31:29+00:00 2026-06-12T01:31:29+00:00

This is a VB.NET winforms project, using EF. The ComboBox is bound to a

  • 0

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.

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.

Any ideas why this might be? Any missing code I will add if required..

The form_load event looks like this:

    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

And the savebutton click event is as follows:

Private Sub FinancialBindingNavigatorSaveItem_Click(sender As System.Object, e As System.EventArgs) Handles FinancialBindingNavigatorSaveItem.Click
    db.SaveChanges()
End Sub

The properties for the ComboBox are shown Below:

ComboBoxProperties

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???

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T01:31:30+00:00Added an answer on June 12, 2026 at 1:31 am

    I think that if you check, the same thing will actually happen with the other columns in the datagridview, if you do not move out of the cell before clicking the save button. The good news is that you only need to add one line of code.

    FinancialDataGridView.CommitEdit(DataGridViewDataErrorContexts.CurrentCellChange)
    

    Now your SaveItem_Click event handler should look like this:

    Private Sub FinancialBindingNavigatorSaveItem_Click(sender As System.Object, e As System.EventArgs) Handles FinancialBindingNavigatorSaveItem.Click
        FinancialDataGridView.CommitEdit(DataGridViewDataErrorContexts.CurrentCellChange)
        db.SaveChanges()
    End Sub
    

    This will commit the dirty cell before the save.

    See https://stackoverflow.com/a/6469559/269123

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is a C++/CLI WinForms project targeting the .NET 2.0 framework. I am using
I'm relatively new to .NET GUI programming using WinForms (the project I'm working on
project: Using VB.NET to build a winforms database interface and work-automation app. I am
project: Using VB.NET to build a winforms database interface and work-automation app. I am
I'm writing a VB.NET Winforms project based on MVVM (using Winforms binding). My instinct
I'm using agsXMPP in my .NET project (WinForms) I have the following Code block,
I have a C#/.NET Winforms application which has some settings stored using A '.settings'
I have compiled a .NET application using Any CPU option. This .NET application uses
I have a .NET WinForms application that I've converted into a COM dll using
I have an existing C# 3.0 WinForms project with .NET 3.5 that talks to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.