How to force CheckedChanged method to fire?

  • Thread starter Thread starter K Viltersten
  • Start date Start date
K

K Viltersten

I have a set of checkboxes and i'd like to make
some of them to get automatically checked, upon
checking of others.

Example:

If the user checks A1, then A should be checked
in as well.

A
A1
A2

I've solved it using the event CheckedChanged.
However, the problem is that the programmatical
checking of A, doesn't fire the method.

This causes a problem if i have a deeper
hierarchy of checkboxes, as shown below. Hints?

A
A1
A1a
A2
 
this.chkboxA.Checked = true;

this.chkboxA_CheckedChanged(
this,
new EventArgs()); // force the change event to
fire


And, make sure you have registered the "CheckedChanged" event
 
Back
Top