Usually, when you set a control’s Enabled property to False, the control will appear grayed out in the form. However, a DataGridView control whose Enabled property is False looks the same as one whose Enabled property is True. Once you try to click in to the DataGridView to edit or add something, you’ll find that it is not enabled, but it doesn’t look any different – which can be confusing to users, especially if it is on a form with other disabled controls that are grayed out.
Here is a little utility function that will manually gray out the headers and cells of a DataGridView. It doesn’t gray out check box columns, but then the checkboxes aren’t grayed out in a disabled CheckedListBox, either, so I figure this is close enough:
Private Sub DisableGrid(ByVal grid As DataGridView)
.Enabled = False
.ForeColor = Color.Gray
For Each col As DataGridViewColumn In .Columns
col.HeaderCell.Style.ForeColor = Color.Gray