Okay, so
I have 2 dropdownlists on my page. both dropdownlists are bound to data in a database. Now I have a datasource, but I want it so that if you select a subject in the first dropdownlist, another dropdownlist gets visible with the different dates of the courses.
cboOndedrwerpen are subjects.
now the only problem is, when I select a subject, the other subjects dissapear from the dropdownlist, because the datasource gets filtered and it will stay filtered, how can I make it so that everytime I pick a subject the dropdownlist gets filled with all subjects again?
Do you think I should use a datareader?
I have 2 dropdownlists on my page. both dropdownlists are bound to data in a database. Now I have a datasource, but I want it so that if you select a subject in the first dropdownlist, another dropdownlist gets visible with the different dates of the courses.
cboOndedrwerpen are subjects.
now the only problem is, when I select a subject, the other subjects dissapear from the dropdownlist, because the datasource gets filtered and it will stay filtered, how can I make it so that everytime I pick a subject the dropdownlist gets filled with all subjects again?
Do you think I should use a datareader?
ProtectedSub cboOnderwerpen_databound(ByVal sender AsObject, ByVal e As System.EventArgs) Handles cboOnderwerpen.SelectedIndexChanged
Me.dtsOnderwerpen.FilterExpression = "onderwerp= '" & Me.cboOnderwerpen.SelectedValue.ToString & "'"
dteGegevens.Visible = True
EndSub
EndSub
ProtectedSub cboDatum_SelectedIndexChanged(ByVal sender AsObject, ByVal e As System.EventArgs) Handles cboDatum.SelectedIndexChanged
Me.dtsOnderwerpen.FilterExpression = "datum= '" & Me.cboDatum.SelectedValue.ToString & "'"
EndSub
Me.dtsOnderwerpen.FilterExpression = "onderwerp= '" & Me.cboOnderwerpen.SelectedValue.ToString & "'"
dteGegevens.Visible = True
EndSub
EndSub
ProtectedSub cboDatum_SelectedIndexChanged(ByVal sender AsObject, ByVal e As System.EventArgs) Handles cboDatum.SelectedIndexChanged
Me.dtsOnderwerpen.FilterExpression = "datum= '" & Me.cboDatum.SelectedValue.ToString & "'"
EndSub
Comment