NCSA SCADA
asked on
bind grid to sqldatasource based on user selection
I have a grid that is bound to a sqldatasource. I also have two additional sqldatasource's.
There is three radio buttons on the page, and when I user clicks one I want to rebind to the correct data source.. here is how I tried to do it, but did not work.. any help would be great (the rad's are set for auto postback)
There is three radio buttons on the page, and when I user clicks one I want to rebind to the correct data source.. here is how I tried to do it, but did not work.. any help would be great (the rad's are set for auto postback)
Protected Sub radShowAll_CheckedChanged(sender As Object, e As EventArgs) Handles radShowAll.CheckedChanged
If radShowAll.Checked Then
RadGrid1.DataSource = SqlAllOps
RadGrid1.DataBind()
End If
End Sub
Protected Sub radActive_CheckedChanged(sender As Object, e As EventArgs) Handles radActive.CheckedChanged
If radActive.Checked Then
RadGrid1.DataSource = SqlActiveOps
RadGrid1.DataBind()
End If
End Sub
Protected Sub radInactive_CheckedChanged(sender As Object, e As EventArgs) Handles radInactive.CheckedChanged
If radInactive.Checked Then
RadGrid1.DataSource = sqlInactiveOps
RadGrid1.DataBind()
End If
End Sub
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I figured out the issue myself
Secondly if you do need multiple datasources, have you tried setting the DataSourceId property instead of the DataSource property?