How to trigger the CheckBox1_CheckedChanged event by change the checked value by code?

  • Thread starter Thread starter David
  • Start date Start date
D

David

Hi

If I change the checked value of the checkbox by code, I can not trigger the
CheckedChanged event of a checkbox control. Is there any way to implement it?



Thank you very much!



David
 
You have to make sure the checkbox "AutoPostBack" property is True.
Hi

If I change the checked value of the checkbox by code, I can not trigger the
CheckedChanged event of a checkbox control. Is there any way to implement it?



Thank you very much!



David
 
Thanks,
but I don't think you understood my question. I want trigger the event when I change the value by code not user click operation.
Sure I have set autopostback to true, other the event would not fire even I use the mouse to click the checkbox.

David
You have to make sure the checkbox "AutoPostBack" property is True.
Hi

If I change the checked value of the checkbox by code, I can not trigger the
CheckedChanged event of a checkbox control. Is there any way to implement it?



Thank you very much!



David
 
I think what you can do is write a new function and move the code in CheckedChanged event into the new function.
Call this function when you change the value of the checkbox and in CheckedChanged event.

Thanks,
but I don't think you understood my question. I want trigger the event when I change the value by code not user click operation.
Sure I have set autopostback to true, other the event would not fire even I use the mouse to click the checkbox.

David
You have to make sure the checkbox "AutoPostBack" property is True.
Hi

If I change the checked value of the checkbox by code, I can not trigger the
CheckedChanged event of a checkbox control. Is there any way to implement it?



Thank you very much!



David
 

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

Back
Top