I am having trouble getting a DataGridView checkbox to show as checked. The DataGridView is bound to a List of a model that is being populated from a database.
There are three values for this model class, 2 strings and a boolean. At run time I can see that inside the list the Boolean value is set to True, but the datagridview check box is still showing without a check.
I do have one DataGridView that is set up the same exact way, its data source is bound to a List of model classes, and it has several Boolean values that are showing checked correctly.
I have been attempting to find solutions for this, and I have rebuilt the datagridview several times to no change. So, I'm not sure where to go from here on resolving this issue.
Here is the code for the securityGroups model that the list is made up of. There are currently only 2 entries, for this, the 'Cashiers' group should not be Checked, the 'Managers' group should be checked.
class securityGroups
{
public string secGroupName { get; set; }
public string companyName { get; set; }
public Boolean InGroup { get; set; }
}
Now I have another model that I am loading the same way and setting a list of the models that go into another datagridview that is working just fine. Here is that model:
class securityAreas
{
public string secAreaName { get; set; }
public string secAreaDesc { get; set; }
public string secAreaGrou { get; set; }
public Boolean Individual { get; set; }
public Boolean Closed { get; set; }
public Boolean Group { get; set; }
}
Edit 2:
The companyName column visible is set to false.
secGroups = dbm.loadSecurityGroups(emp.empSec);
empSecGroups = secGroups;
dgEmpSecGroups.DataSource = secGroups;
dgEmpSecGroups.Columns[0].ReadOnly = true;
dgEmpSecGroups.Columns[1].ReadOnly = true;
dgEmpSecGroups.Columns[1].Visible = false;
Here is the code that sets up the datagridview. secGroups is a list of securityGroups model, which is being loaded from a database from my dbm class and returned to the form to load the datagrid.