mardi 27 juin 2017

DataGrid BindingSource Checkbox Filters

I have a DGrid that is attached to a BindingSource which is full of data. I am trying to use checkboxes for the user to filter out data in a specific column named 'Status'. I have four checkboxes as there will be four different data text in the same column (Column is on the far right). Picture here

Obviously when the user checks/unchecks one of the checkbox it will set a filter to the grid to add/remove that data in the column.

How would I go about doing this? Obviously I would attach a CheckChanged function to each checkbox and apply the filter using bs.Filter but what would be the best way to check if the other checkboxes are checked and aren't checked so I can concat the filter string? Would I have to use a ton of If statements for each checkbox to see if it's checked?




Aucun commentaire:

Enregistrer un commentaire