Dirty but worky
Iterate through the datagridview columns and set them to Visible = false or Visible = true.
You have to do this in the checkBox_checkstatechanged event
for(int i = 0; i < datagridview1.columns.count; i++)
{
if(checkbox.checked)
{
datagridview1.columns[i].visible = true;
}
else if(...etcetc...
}
Edit: Typo and Line 5