I am building a dispatchers application for the Red Cross in my region. The dispatcher will see a list (DataGridView) with all units under his/her control. Each row (unit) has 7 columns.
eid (text)
roepnr (text)
locatie (ComboBox)
melding (text)
telefoon (text)
functie (text)
status (ComboBox)
The items in both ComboBoxes must be added programmatically. The items are listed in tables in the database. This is because the dispatcher (or supervisor) must be able to add items like locations, statuses etc.
How can I add these units to the DataGridView and have the correct Locatie
and Status
be selected? Both are integer columns in the units table in the database. The integers are the foreign keys which correspond with the primary keys in the tables "locaties" and "statussen."
First I thought I could use the DataSource property to add the units to the DataGridView. But I'm not sure how I can have the correct items selected in the ComboBoxes and have the items added to the ComboBoxes.
The database is a MySql database!