我试过了:
If e.KeyCode = 13 Then
Me.PigletsBindingSource.Filter = "EN like " & txtSearch.Text.ToString() & " %"
End If
虽然它给我一个错误Missing operand before 'Mod' operator
怎么了?
我正在研究一个有界DGV的搜索引擎,因为只有通过向下滚动才能找到太多的数据。感谢
答案 0 :(得分:1)
Dim dv As New DataView
dv.Table = MrlivestockDataSet.Tables("piglets")
dv.RowFilter = "EN = '" & txtSearch.Text & "' "
dgvReports.DataSource = dv
答案 1 :(得分:1)
尝试这样:
Dim bs as BindingSource = new BindingSource()
bs.DataSource = dataGridView1.DataSource
bs.Filter = "EN = '" & txtSearch.Text & "%'"
dataGridView1.DataSource = bs