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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T23:13:11+00:00 2026-05-24T23:13:11+00:00

I have 2 DataGridViews (DGVs). theChipDGV will contain data like this (except with many

  • 0

I have 2 DataGridViews (DGVs).

theChipDGV will contain data like this (except with many more columns):

______________________________________________________________
|  NAME  |  P/N   |  X     |  Y     |  ROTATION  |  PACKAGE  |
|________|________|________|________|____________|___________|
| R16    | 147479 | 20.325 | 100.000| 0          | 0603      |
| C6     | 14739  | -5.325 | -10.105| 180        | 0603      |
| U45    | 123456 | 12.345 | 12.345 | 45         | 0402      |
|________|________|________|________|____________|___________|

theDataBaseDGV will contain data like this (except with many more columns):

____________________________________________________________________________________________
|  PACKAGE  |  DESCRIPTION  |  FEEDER  |  VISION  |  SPEED  |  MACHINE  |  WIDTH  |  TIME  |
|___________|_______________|__________|__________|_________|___________|_________|_______ |
| PLCC20    |  N/A          | 25MM     |  N/A     |  3      | UNIVERSAL |  12MM   |  0.05  |
| 0603      |  0603C_1.0    | 8X4      |  1       |  1      |   FUJI-1  |  8MM    |  20    |
| 0603      |  0603R_1.0    | 12X4     |  1       |  5      |   FUJI-2  |  16MM   |  0.20  |
|___________|_______________|__________|__________|_________|___________|_________|_______ |

What I would like to do is match the column in theChipDGV labeled PACKAGE with the same labeled column in theDataBaseDGV. If there is a match, the entire row will be concatted into a new DGV (let’s label it: theFinalDGV). Also, if the PACKAGE type is matched and is also in the next line (like 0603) it will check to see if the column labeled Name in theChipDGV starts with a R or a C. Depending on which it starts with will determine the rest of the columns from theDataBaseDGV that will be used.

SO:

theFinalDGV will look like this:

_____________________________________________________________________________________________________________________________________________
|  NAME  |  P/N   |  X     |  Y     |  ROTATION  |  PACKAGE  |  DESCRIPTION  |  FEEDER  |  VISION  |  SPEED  |  MACHINE  |  WIDTH  |  TIME  |
|________|________|________|________|____________|___________|_______________|__________|__________|_________|___________|_________|________|
| R16    | 147479 | 20.325 | 100.000| 0          | 0603      |  0603R_1.0    | 12X4     | 1        | 5       | FUJI-2    | 16MM    | 0.20   |
| C6     | 14739  | -5.325 | -10.105| 180        | 0603      |  0603C_1.0    | 8X4      | 1        | 1       | FUJI-1    | 8MM     | 20     |
| U45    | 123456 | 12.345 | 12.345 | 45         | 0402      |               |          |          |         |           |         |        |
|________|________|________|________|____________|___________|_______________|__________|__________|_________|___________|_________|________|

Notice, if there is no match it leaves the columns empty.

So:

Does anyone know how I can possibly go about doing this? I mostly would like to know how to match the values from 1 column with another and if there are multiple columns from theDataBaseDGV that have the same values.. then how to properly match those.

  • 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-24T23:13:12+00:00Added an answer on May 24, 2026 at 11:13 pm
                int chipRowCount = theChipDGV.RowCount;
                int dataBaseRowCount = theDataBaseDGV.RowCount;
    
                for (int count = 0; count < chipRowCount; count++)
                {
                    for (int i = 0; i < dataBaseRowCount; i++)
                    {
                        if (theChipList[count].PkgStyle.Equals(theDataBaseList[i].PackageType) || (theChipList[count].PkgStyle.Contains(theDataBaseList[i].PackageType) &&
                            theDataBaseList[i].PartDescription.Contains("R") && theChipList[count].Name.StartsWith("R")) || ((theChipList[count].PkgStyle.Contains(theDataBaseList[i].PackageType) &&
                            theDataBaseList[i].PartDescription.Contains("C") && theChipList[count].Name.StartsWith("C"))))
                        {
                            if (!theChipList[count].Used)
                            {
                                theChipList[count].Used = true;
                                theFinalList.Add(new LoadLine(theChipList[count].Name, theChipList[count].PartNumber,
                                    theChipList[count].XPlacement, theChipList[count].YPlacement, theChipList[count].Rotation,
                                    theChipList[count].PkgStyle, theDataBaseList[i].PackageType, theDataBaseList[i].PartDescription,
                                    theDataBaseList[i].Feeder, theDataBaseList[i].Vision, theDataBaseList[i].Speed,
                                    theDataBaseList[i].Machine, theDataBaseList[i].TapeWidth, 0));
    
                                theFinalDGV.DataSource = theFinalList;
                            }
                        }
                    }
                }
    
                for (int count = 0; count < theChipList.Count; count++)
                {
                    if (!theChipList[count].Used)
                    {
                        theFinalList.Add(new LoadLine(theChipList[count].Name, theChipList[count].PartNumber,
                            theChipList[count].XPlacement, theChipList[count].YPlacement, theChipList[count].Rotation,
                            theChipList[count].PkgStyle, string.Empty, string.Empty, string.Empty, string.Empty,
                            string.Empty, string.Empty, string.Empty, 0));
                    }
                }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a windows form that has two DataGridViews (DGVs) that will hold 25,000+
I have a DataGridView binded to this table: [Users] ID Name -- ---- 11
I have two DataGridViews, one with data bind by a BindingSource and the second
I have 2 DataGridViews and I transfer data between them. My question is: How
I have a datagridview where the users can select which subset of columns to
I have a DataGridView which I add data to programatically. I have the AutoSizeRowsMode
I have a ListBox and 2 DataGridViews. I have an Object which has [Serializable]
I have a Windows Form that displays several DataGridViews in the following layout: (No
I am new to ADO.net and have this problem: Let's assume I have these
Is there some way to avoid this. I have a lot of classes that

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.