How to force CheckedChanged method to fire?

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
 
H

harborsparrow

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,022
Latest member
MaybelleMa

Latest Threads

Top