Your method is not quite what I want. You method is to selected the line across the pick choice, not for user to have a choice and pick again. Because in my datagridview, there are hundreds of data. There are QA, RA, RE, etc... And in QA, there are MP1, MP2, MP3..., and on RA, there are 41H0, 42H1, 43H2... What I want is if users pick QA, the choice MP1, MP2, MP3... will automatically show up and users will then pick for the choice MP1, MP2 or MP3... to narrow down the search.
What you are describing is accomplished as I explained. You must simply set up the binding as needed.
BindingSource1 should have its DataSource set to the table that contains QA, RA, RE, etc. And then BindingSource2 should have its DataSource set to BindingSource1 and its DataMember set to the name of the relationship that connects to the table containing MP1, MP2, MP3, 41H0, 41H1, etc. Then, if there is a third table with a relationship to the second table, you create a thrid BindingSource that has its DataSource set to BindingSource2 and its datamember set to that relationship.
In this way you would have listbox1-bindingsource1 for the user to select the parent item, which would display the related items in listbox2, and selecting one of those would show the items related to the item in listbox2 in whatever contol you choose - another listbox or combobox or whatever.
If that doesn't fit you're need, try to better describe your dataset schema.
Hope that helps.
This is still just a matter of setting up the binding correctly. But I can't get a clear picture of how your database looks and which controls are bound to which table.
First, please describe the DataSet:
Next, describe the controls in the user interface:
Finally, try to better describe the process that the user would go through in order to use this form.
If you make the intended design more clear, we should be able to determine how the controls need to be bound to suit your purpose - or we'll discover that your database and/or logic need to be redesigned.
FIRST: I have 4 table (1. PART 2. LOCATION 3.WAREHOUSE 4. LOT).
I take:
ID column from PART
Date/Time column and warehouse column from WAREHOUSE
Location column from LOCATION
Lot_no from LOT
ALL OF THESE TABLE HAVE RELATES WITH EACH OTHER, THERE ALSO SOME COLUMN THAT HAVING EXACTLY INFORMATION (but I do not use/show in my datagridview)
I combine all those columns mention above and put it under one datagridview
SECOND: I use bindingsouce so that warehouseListBox will read Warehouse column (from datagridview) and display value so user can pick their choice, same thing with listbox2 for Location.
This is where I get the problem. In my form there are two list boxt, and two text box, searchbtn, and closebth (for now let not worried about textbox and closebtn). listbox1 is warehouseListBox, and listbox2 is locationListBox. (When I user bindingsource, it read the whole column even which the repeat words. I am trying to figure out a way to get it of the repeat words/choice). Get back to the listbox, in warehouseLstBox there should be QA, RA, FLOOR, ect... and In QA, there should be other choice like MP1, MP2, MP3...(same thing with RA, choice 41H0, 42H1, 43H2... ). If user choose QA, I want MP1, MP2, MP3... choice to show up and user can choose again. For example, if user choose QA and MP1 and when they click searchbtn, only WareHouse column with QA and MP1 in LOCATION column should show up on the datagridview.
I hope that I don't confuse you
Thank you all for your guidance
Are you describing your dataset or database You keep saying "combine into one datagridview" - do you mean that you are using InnerJoins in your SELECT statement
You need to have all four tables in the DataSet designer. You need to specify the relationships in the DataSet designer. It sounds like you may only have 1 table in the dataset that is pulling data from multiple tables in the database using inner joins in the select statement...