I want to change my filter expression if a certain item is selected in a dropdownlist and the person clicks the button
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
If DropDownList1.SelectedItem.Text = "JOANNEP" Or DropDownList1.SelectedItem.Text = "ANAB" Then
SqlDataSource1.FilterExpression = "byyyy <> 2009"
Else
SqlDataSource1.FilterExpression = Nothing
End If
UpdatePanel1.Update()
End Sub
i tryed that however my gridview still shows byyyy years that include 2009
Try calling
gridView1.DataBind()after theIf-Else-EndIfblock;EDIT: Just guessing but try this