M
Mika M
Well...I think I'm closer to solve this when tried like this way ...
Private Sub BindControls()
Dim cb As ComboBox
'// *** Departments ***
cb = cboDepartment
cb.DataSource = ds.Tables("Departments")
cb.DisplayMember = "Department"
cb.ValueMember = "ID"
'// *** Teams ***
cb = cboTeam
cb.DataSource = ds.Tables("DepartmentTeams")'<-- relation between
departments (parent) and teams (child)
cb.DisplayMember = "Team"
cb.ValueMember = "ID"
End Sub
Private Sub cboDepartment_SelectedValueChanged(ByVal sender As Object, ByVal
e As System.EventArgs) Handles cboDepartment.SelectedValueChanged
'// *** Get Teams for the selected Department ***
cboTeam.DataSource =
ds.Tables("Departments").Rows(cboDepartment.SelectedIndex).GetChildRows("Dep
artmentTeams")
End Sub
.... It is retrieving correct amount of items into cboTeams, but all items
are "System.Data.DataRow" How to get correct item text?
Private Sub BindControls()
Dim cb As ComboBox
'// *** Departments ***
cb = cboDepartment
cb.DataSource = ds.Tables("Departments")
cb.DisplayMember = "Department"
cb.ValueMember = "ID"
'// *** Teams ***
cb = cboTeam
cb.DataSource = ds.Tables("DepartmentTeams")'<-- relation between
departments (parent) and teams (child)
cb.DisplayMember = "Team"
cb.ValueMember = "ID"
End Sub
Private Sub cboDepartment_SelectedValueChanged(ByVal sender As Object, ByVal
e As System.EventArgs) Handles cboDepartment.SelectedValueChanged
'// *** Get Teams for the selected Department ***
cboTeam.DataSource =
ds.Tables("Departments").Rows(cboDepartment.SelectedIndex).GetChildRows("Dep
artmentTeams")
End Sub
.... It is retrieving correct amount of items into cboTeams, but all items
are "System.Data.DataRow" How to get correct item text?