I am checking the state of each row in a checked list box. If the item is checked I would like to filter a datatable by that item. I don't know how to handle if more than one item is checked in the list box. I am trying to build a string value for the filter but it will only filter by the last item selected. My problem is building the string with multiple variables inside the for/next.
Thanks for the help
iFurnaceCount = chkFilterFurnaces.Items.Count()
For z = 0 To iFurnaceCount - 1
iFurnaceName = chkFilterFurnaces.Items(z)
x = chkFilterFurnaces.GetItemCheckState(z)
If x = 1 Then
strFilter = "Furnace = " & iFurnaceName & " OR Furnace = " & iFurnaceName
gdtTentative.DefaultView.RowFilter = strFilter
End If
Next z
Thanks for the help
iFurnaceCount = chkFilterFurnaces.Items.Count()
For z = 0 To iFurnaceCount - 1
iFurnaceName = chkFilterFurnaces.Items(z)
x = chkFilterFurnaces.GetItemCheckState(z)
If x = 1 Then
strFilter = "Furnace = " & iFurnaceName & " OR Furnace = " & iFurnaceName
gdtTentative.DefaultView.RowFilter = strFilter
End If
Next z