H
hansiman
I have a drop down list and a datagrid.
The dropdownlist is populated on pageload.
I' like to databind the datagrid when user selects in dropdownlist:
Something like this:
Private Sub cbo1_SelectedIndexChanged(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles cbo1.SelectedIndexChanged
dgr.DataSource = GetDataSet(connection, _
"SELECT * FROM Orders Where CustomerID = " _
"'" & cbo1.SelectedItem.Value & "';")
dgr.DataBind()
End Sub
If I add a button it works just fine.
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As _
System.EventArgs) Handles Button1.Click
dgr.DataSource = GetDataSet(connection, _
"SELECT * FROM Orders Where CustomerID = " _
"'" & cbo1.SelectedItem.Value & "';")
dgr.DataBind()
End Sub
/morten
The dropdownlist is populated on pageload.
I' like to databind the datagrid when user selects in dropdownlist:
Something like this:
Private Sub cbo1_SelectedIndexChanged(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles cbo1.SelectedIndexChanged
dgr.DataSource = GetDataSet(connection, _
"SELECT * FROM Orders Where CustomerID = " _
"'" & cbo1.SelectedItem.Value & "';")
dgr.DataBind()
End Sub
If I add a button it works just fine.
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As _
System.EventArgs) Handles Button1.Click
dgr.DataSource = GetDataSet(connection, _
"SELECT * FROM Orders Where CustomerID = " _
"'" & cbo1.SelectedItem.Value & "';")
dgr.DataBind()
End Sub
/morten