G
Guest
Hi all,
An easy question!
I have a datagrid that can needs to provide filter functionality.
I have three controls above the grid (txtSearch,ddlSearchBy,btnSearch)
btnSearch calls btnSearch_Click.
Here is my code:
Sub btnSearch_Click(ByVal Sender As Object, ByVal e As System.EventArgs)
Dim Dv As New DataView(CType(dgEmps.DataSource,DataTable)
Dv.RowFilter = "first_name like '%b'%"
dgEmps.DataSource = Dv
dgEmps.DataBind()
End Sub
Unfortunately i have had no joy with this code though i know the db contains
a first_name like 'b'.
I am a little tired, so can someone give me a heads up on the best way to
approach this using the DataSet object populating my DataGrid.
Thought: The DataSet for the datagrid is available after first page call is
it?
Cheers,
Adam
An easy question!
I have a datagrid that can needs to provide filter functionality.
I have three controls above the grid (txtSearch,ddlSearchBy,btnSearch)
btnSearch calls btnSearch_Click.
Here is my code:
Sub btnSearch_Click(ByVal Sender As Object, ByVal e As System.EventArgs)
Dim Dv As New DataView(CType(dgEmps.DataSource,DataTable)
Dv.RowFilter = "first_name like '%b'%"
dgEmps.DataSource = Dv
dgEmps.DataBind()
End Sub
Unfortunately i have had no joy with this code though i know the db contains
a first_name like 'b'.
I am a little tired, so can someone give me a heads up on the best way to
approach this using the DataSet object populating my DataGrid.
Thought: The DataSet for the datagrid is available after first page call is
it?
Cheers,
Adam