How to force CheckedChanged method to fire?

Discussion in 'ASP .Net' started by K Viltersten, Oct 11, 2009.

  1. K Viltersten

    K Viltersten Guest

    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

    --
    Regards
    K Viltersten
    ----------------------------------------
    May all spammers die an agonizing death;
    have no burial places; their souls be
    chased by demons in Gehenna from one room
    to another for all eternity and beyond.
     
    K Viltersten, Oct 11, 2009
    #1
    1. Advertising

  2. 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


    On Oct 11, 3:27 pm, "K Viltersten" <> wrote:
    > 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
    >
    > --
    > Regards
    > K Viltersten
    > ----------------------------------------
    > May all spammers die an agonizing death;
    > have no burial places; their souls be
    > chased by demons in Gehenna from one room
    > to another for all eternity and beyond.
     
    harborsparrow, Oct 12, 2009
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Greg Hurlman
    Replies:
    5
    Views:
    1,958
    Greg Hurlman
    Dec 4, 2003
  2. Chris Jackson
    Replies:
    0
    Views:
    543
    Chris Jackson
    Dec 9, 2003
  3. Jump Off!

    CheckedChanged Event doesn't work?

    Jump Off!, Jul 7, 2004, in forum: ASP .Net
    Replies:
    3
    Views:
    8,348
  4. Piotr Strycharz

    CheckedChanged does not fire in Repeater

    Piotr Strycharz, Sep 14, 2004, in forum: ASP .Net
    Replies:
    3
    Views:
    5,428
  5. Biguana
    Replies:
    3
    Views:
    523
Loading...

Share This Page