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
Mike GoldPosted Mar 26, 2007, 2:45 PM
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;
}