Skip to content

How to block ItemCheck Event at PageLoad of CheckedListBox Control

pashi

Asked Mar 26, 2007, 5:45 AM EDT1 answer
Share
LinkedInX
Hi all,
i'm working on CheckedListBox, where in which i am using itemCheck event To capture the checked and unchecked values of checkboxes of CheckedListBox,
But here if Am loading some values

Please help me how to block the itemChecked event at the time of pageload
thnx in advace,
prashanth

1 Answer

Know the answer? Post it. Somebody with the same question will find it here.

  • Mike Gold
    0

    you have a few choices here.  You can postpone the subscription to the event until after the load or you can block it with a flag.

    The way to block with a flag is to set a boolean member:

    bool _dontProcessEventNow = true;

    When you get to the event handler, block it until you are ready to use it:

    itemChecked_Click
    {
    if (_dontProcessEventNow)
    return;
    }

    0