I have a DataGridView which contains the columns of a table from a MySql database. Some of these columns are foreign keys, and these foreign keys are defined as ComboBox-es that take the values from the parent table. What I want to do and I don’t know how is to “connect” o selection from one column with another column.
I’m giving an example to be more explicit:
In the parent table t1, I have 2 columns: Process_number and process_name.
Now in the table t2 I have more columns, between whom the two columns from above which are combobox-es and can only take values already existing in those columns from t1 table. Until here everything works fine. Now when I choose a value in the Process_number column from t2 table, I want the value from the column process_number from t2 to be automatically inserted with the corresponding value from the process_number column from t1 .
For example if in t1 I have the following values:
1 in process_number and AAA in process_name
1 in process_number and BBB in process_name
when in table t2 I choose in process_number the value 1, automatically in process_name I want to appear AAA, respectively if I choose 2 to appear BBB.
I hope that I wasn’t too ambiguous and I managed to explain what I need. Any suggestion would be a great help!
Thank you
I’m giving an example to be more explicit:
In the parent table t1, I have 2 columns: Process_number and process_name.
Now in the table t2 I have more columns, between whom the two columns from above which are combobox-es and can only take values already existing in those columns from t1 table. Until here everything works fine. Now when I choose a value in the Process_number column from t2 table, I want the value from the column process_number from t2 to be automatically inserted with the corresponding value from the process_number column from t1 .
For example if in t1 I have the following values:
1 in process_number and AAA in process_name
1 in process_number and BBB in process_name
when in table t2 I choose in process_number the value 1, automatically in process_name I want to appear AAA, respectively if I choose 2 to appear BBB.
I hope that I wasn’t too ambiguous and I managed to explain what I need. Any suggestion would be a great help!
Thank you