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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T17:44:09+00:00 2026-05-25T17:44:09+00:00

I have a form ( form1 ) with a dataGridView listing customer orders from

  • 0

I have a form (form1) with a dataGridView listing customer orders from a table called “Orders“. When an order is selected in the dataGridView and the EnterKey is pressed, another form (form2) pops-up. This popup form2 has another dataGridView that supports adding rows where the user enters a new record related to the selected order into a table called “OrderDetails” which has a foreigh key column called OrderNumber which refers to the OrderNumber column in table “Orders”.

Problem:

when the user is entering a new record from the dataGridView on form2 into the orderDetails table, i want the OrderNumber column to be populated automatically. Its value should be the order number value of the selected record on form1 such that the user doesn’t have to type it manually since its already known. Help.

The datagridview is bound to a bidningSource.

  • 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-25T17:44:10+00:00Added an answer on May 25, 2026 at 5:44 pm

    just got it working the way i wanted with

    private void dataGridView1_DefaultValuesNeeded(object sender,
        System.Windows.Forms.DataGridViewRowEventArgs e)
    {
    
      e.Row.Cells["CustomerNumber"].Value = myOrderNumberValue;
    
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a form with a DataGridView and I want to load data from
I have a form (Form1) that has a NotifyIcon on it. I have another
I'm passing a bool from one form to another, I have tried declaring 'Private
I have datagridview in form1. How can I access datagridview from form2. private void
I have a DataGridView in a form that has a data table as the
I have a form with a datagridview and when user start entering value for
I have a form with a DataGridView showing a list of customers, and some
I have a Form with a DataGridView which DataSource is a BindingSource to a
I have a form that contains dataGridView, whose coloumn are set to dgrv1.Width =dgrv1.Columns.GetColumnsWidth(DataGridViewElementStates.Visible)+20;
In VB.net 3.5 SP1 I have a Windows Form with three DataGridView controls. One

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.