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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T13:10:53+00:00 2026-05-27T13:10:53+00:00

I have a combobox which is connected to the database so I populate the

  • 0

I have a combobox which is connected to the database so I populate the value of my combobox based on what’s in my database. my combobox is another FORM from the datagrid. So here’s I want to achieve.

form1 = datagrid (based on the database)
form2 = combobox (based on the database)

I want that If I highlight a certain row (My selection mode = fullrowselect) and press a button the comboBox will automatically point to that row.

for ex.
datagrid

  1. name: Joe (highlighted)
  2. *user clicks the button whch in my case is edit
  3. *load edit form
  4. comboBox.SelectedIndex is = highlighted row (which the user clicks)

I can show you my code if it helps. thanks :))

THANKS! :))

  • 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-27T13:10:53+00:00Added an answer on May 27, 2026 at 1:10 pm

    You can try to set in the following ways, you can pass the value Joe to the other form via a parameter in the constructor. This could be then used to select you required value in the ComboBox

    comboBox2.SelectedIndex = comboBox2.Items.IndexOf("Joe");

    comboBox2.SelectedText = "Three"; // or SelectedValue depending on how you are binding

    EDIT
    Avoid accessing the grid directly from the other form, expose the value required as a property or better pass it to the new form as parameter.

    Joe could be the value of the cell like dataGridView2.CurrentRow[0].FormattedValue and pass this to the new form constructor like new Form2(object datagridvalue). Then use the value in the form later on.

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

Sidebar

Related Questions

i have a combobox which is displaying date from database...in my database the date
I have a combobox which binds data from the database. It gets the data
I have a combobox from which i need to programmatically disable items depending on
I have one combobox on the window form and I have one method which
Am working on smartphone application. Here I have a combobox which loads when the
I have a datagridview with a bound combobox column which contains decimal value. There
I would like to have a ComboBox control on a form which will be
What I want is to have a ComboBox which, upon SelectedIndexChanged , changes a
I have a ComboBox in WPF which is databound, and has data template which
I have a datagridview and a combobox which get populated randomly with data. However,

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.