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 8148731
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T14:42:13+00:00 2026-06-06T14:42:13+00:00

I have DataGridView with two columns. The first column is TextBoxCol(DataGridViewTextBoxColumn) and the Second

  • 0

I have DataGridView with two columns. The first column is TextBoxCol(DataGridViewTextBoxColumn) and the Second one is ComboBoxCol(DataGridViewComboBoxColumn).

How can I change the value of TextBoxCol when ComboBoxCol changes its selected index value?
(This should happen when selected index changed in ComboBoxCol. Not after leaving the column, like dataGridView_CellValueChanged)

I have read one topic with almost the same problem that I am having but I dont understand the answer(which should be correct base on the check mark). Here’s the link. -Almost same topic

  • 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-06T14:42:14+00:00Added an answer on June 6, 2026 at 2:42 pm

    Give these two simple methods a go (the ‘1’ in the top method is the index of the combobox column)

    The line that you would make you modifications to would be the setter line cel.Value =, as you may change it to whatever you like.


        private void dataGridView1_EditingControlShowing(object sender, DataGridViewEditingControlShowingEventArgs e)
        {
            if (dataGridView1.CurrentCell.ColumnIndex == 1 && e.Control is ComboBox)
            {
                ComboBox comboBox = e.Control as ComboBox;
                comboBox.SelectedIndexChanged -= LastColumnComboSelectionChanged;
                comboBox.SelectedIndexChanged += LastColumnComboSelectionChanged;
            }
        }
    
        private void LastColumnComboSelectionChanged(object sender, EventArgs e)
        {
            var currentcell = dataGridView1.CurrentCellAddress;
            var sendingCB = sender as DataGridViewComboBoxEditingControl;
            DataGridViewTextBoxCell cel = (DataGridViewTextBoxCell)dataGridView1.Rows[currentcell.Y].Cells[0];
            cel.Value = sendingCB.EditingControlFormattedValue.ToString();
        }
    

    enter image description here

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

Sidebar

Related Questions

I currently have a 2-column wide DataGridView, the first column being a DataGridViewTextBoxColumn and
I have datagridview with checkbox column, but I want, that some of the columns
I have a DataGridView in which one column has data that the user needs
I have a DataGridView containing two columns. What I want columns to behave is,
I have a DataGridView control with two columns. The default color of the text
How do I sort a DataGridView by two columns (ascending)? I have two columns:
I have a datagridview with a bound combobox column which contains decimal value. There
I have a datagridview bound to a bindingsource. Two of the columns contain values
I have two columns in dataGrid view : Price Amount and a third column
I have a Winforms DataGridView in my application. I've two checkbox columns along with

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.