View Single Post
 
Old November 21st, 2009, 12:13 PM
headworth headworth is offline
Authorized User
 
Join Date: Jul 2009
Posts: 30
Thanks: 10
Thanked 0 Times in 0 Posts
Question ddlColumnName

This is the code I am using
[Code]

Protected Sub btnFilter_Click(ByVal sender As Object, ByVal e As EventArgs) Handles Me.Load

Dim AccessDataSource1 As New AccessDataSource


Dim FilterExpression As String = String.Concat(ddlColumnName.SelectedValue, " LIKE '%{0}%'")


AccessDataSource1.FilterParameters.Clear()


AccessDataSource1.FilterParameters.Add(New ControlParameter(ddlColumnName.SelectedValue, "txtFilterExpression", "Text"))


AccessDataSource1.FilterExpression = FilterExpression

End Sub


Protected Sub PopulateDropDownListWithColumnNames()
Dim GridView1 As New GridView
For Each col As BoundField In GridView1.Columns
ddlColumnName.Items.Add(New ListItem(col.HeaderText, col.HeaderText))
Next
End Sub
[Code\]