G
Guest
Hi,
I'm building a test application I call JukeBox, with an Access DB working
with Ole Db. In there I have an Albums table and an Artists table. In the
first I have an ArtistID column that points to an ID in the Artists table.
Now what I'd like to do would be to have a datagrid that's bound to the
Albums table, but to have a combobox that would contain all the entries of
the Artists table, and that would somehow be bound to the ArtistID entry in
the Albums table (i.e.: when an album is selected in the datagrid, the
corresponding artist is selected in the combo, and when an artist is selected
in the combom the change is affected to the datagrid).
Now, using this:
comboArtists->DataSource = dtAlbums->DefaultView;
comboArtists->DisplayMember = "Artists.Name";
comboArtists->ValueMember = "ArtistID";
I can get the combo to display all the artists that are used in the Albums
table, but that's not really what I want.
Is there a simple way to do this or would I have to do it manually with the
"Changed" events of the datagrid and the combobox?
I'm building a test application I call JukeBox, with an Access DB working
with Ole Db. In there I have an Albums table and an Artists table. In the
first I have an ArtistID column that points to an ID in the Artists table.
Now what I'd like to do would be to have a datagrid that's bound to the
Albums table, but to have a combobox that would contain all the entries of
the Artists table, and that would somehow be bound to the ArtistID entry in
the Albums table (i.e.: when an album is selected in the datagrid, the
corresponding artist is selected in the combo, and when an artist is selected
in the combom the change is affected to the datagrid).
Now, using this:
comboArtists->DataSource = dtAlbums->DefaultView;
comboArtists->DisplayMember = "Artists.Name";
comboArtists->ValueMember = "ArtistID";
I can get the combo to display all the artists that are used in the Albums
table, but that's not really what I want.
Is there a simple way to do this or would I have to do it manually with the
"Changed" events of the datagrid and the combobox?