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
How to block ItemCheck Event at PageLoad of CheckedListBox Control
1 Answer
Know the answer? Post it. Somebody with the same question will find it here.
Mike GoldRank #50 · 30.6K pointsPosted Mar 26, 2007, 10:45 AM EDT
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;
}