Link to home
Start Free TrialLog in
Avatar of wiswalld
wiswalldFlag for United States of America

asked on

Filter a datagridview with two criteria

Filter a datagridview with two criteria. I currently use one but to also filter by the current date.

 Dim dv As DataView = m_DataSet.Tables("tbl_employee").DefaultView
        dv.RowFilter = "Shift='" & Me.ComboBox2.Text & "'"
        DataGridView1.DataSource = dv
Avatar of Bob Learned
Bob Learned
Flag of United States of America image

Try this:

dv.RowFilter = String.Format("Shift='{0}' And Factory={1}", Me.ComboBox2.Text, Me.cboFactory.Text)

Bob
ASKER CERTIFIED SOLUTION
Avatar of Wayne Taylor (webtubbs)
Wayne Taylor (webtubbs)
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial