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

  • SEARCH
  • Home
  • 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 6654621
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T01:24:42+00:00 2026-05-26T01:24:42+00:00

After select a value in DataGridView ComboBox and click a save button in bindingnavigator,

  • 0

After select a value in DataGridView ComboBox and click a save button in bindingnavigator, data doesn’t get update in database. User must lose focus in order to get the data updated. Is there a way to fix this problem ?

  • 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-05-26T01:24:43+00:00Added an answer on May 26, 2026 at 1:24 am

    Weird. I have done this recently and it worked like a charm. In my application when the gridview is in Edit mode (Readonly false), and when you select the cell, it will become combobox and when you leave the cell it will behave as textbox. Here is what I did

    void dgUpdateItems_CellEnter(object sender, DataGridViewCellEventArgs e)
    {
        DataGridView dg = (DataGridView)sender;
        if (e.ColumnIndex == dg.Columns["ItemCategory"].Index)
        {
            if (e.ColumnIndex == e.RowIndex)
            {
                dg[e.ColumnIndex, e.RowIndex].ReadOnly = true;
                return;
            }
            DataGridViewComboBoxCell cmbCell = new DataGridViewComboBoxCell();
            ComboUpdate(cmbCell);
            cmbCell.Value = ((DataGridView)sender)[e.ColumnIndex, e.RowIndex].Value.ToString();
            ((DataGridView)sender)[e.ColumnIndex, e.RowIndex] = cmbCell;
        }
    }
    
    void dgUpdateItems_CellLeave(object sender, DataGridViewCellEventArgs e)
    {
        DataGridView dg = (DataGridView)sender;
        if (e.ColumnIndex == dg.Columns["ItemCategory"].Index)
        {
            if (e.ColumnIndex == e.RowIndex)
                return;
    
            string str = dg[e.ColumnIndex, e.RowIndex].Value.ToString();
            DataGridViewComboBoxCell cmb = (DataGridViewComboBoxCell)dg[e.ColumnIndex, e.RowIndex];
            string val = cmb.Value.ToString();
    
            dg[e.ColumnIndex, e.RowIndex] = new DataGridViewTextBoxCell();
            dg[e.ColumnIndex, e.RowIndex].Value = val;
    

    It is some part of my code if not understanding, let me know.
    Here is a link check it out. It may help.
    ComboBox in DatagridView in Edit Mode

    And sorry, forgot to tell you most important thing, it worked even when it is focused.
    And if you are looking for something else, please throw a stone on my head.
    Hope it helps.

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

Sidebar

Related Questions

I have a combobox (select) and i want to select after a specified value
I call a remote data source and get back json. After I select an
is there any solution to show user all countries and after select country it
I have a DataGridView that has MultiSelect = true. After the user selects different
I am trying to do select box, where after select some option value will
When I select a value in the dropdownlist I get a postback and the
Can a default value Select One be set to SelectOneMenu component after a validation
How do I get current value of an html select then pass it to
I want to delete several row mysql database together after select with checkbox in
I have a problem refreshing a DataGridView control after Insert or Update . The

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.