Click here to Skip to main content
15,897,113 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I am trying to display Checked OR UnChecked AND Disabled check boxes on DataGridView in windows application. I tried to inherit DataGridViewCheckBoxColumn and DataGridViewCheckBoxCell and tried to override Paint() of it but could not get check boxes painted at desired locations since grid is containignother column also with 5 column of check boxes. Can anyone suggest me the easier solution?
Posted

1 solution

In my case, I bind the DatagridView with a List.
Each element of the list inherits INotifyPropertyChanged. So, using this way, I made the change directly in the list:

private void CheckTheBoxes()
{
if (CheckAll== true)
{
foreach (ODBC o in ODBCList)
{
o.Check= true;
}

tmpControl= false;

}
else
{
foreach (ODBC o in ODBCList)
{
o.Check= false;
}

tmpControl= true;
}
}
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900