Event won't fire

G

Guest

I have a form with five buttons, but only two of the buttons fire the event
assigned to them when clicked. I've checked the *.designer.cs and all five
buttons have events assigned to them. For example, I have cmdCancelCategory
assigned as follows:

this.cmdCancelCategory.Click += new
System.EventHandler(this.cmdCancelCategory_Click);

I have a function called cmdCancelCategory_Click in the code behind the form
to handle the event, but it doesn't get fired.

What could be causing this problem?
 
V

VJ

Can you put a break point in the very first line of the event and see if it
goes there... and debug from there. If it does not, can you post a sample of
your problem?

VJ
 
G

Guest

I put a breakpoint there, but it never enters the function. I'm not entirely
sure, but I think it may be resulting from binding the controls to a
BindingSource tied to a business object. I noticed that I can enter a new
Category Code when I click the cmdNewCategory button, but it won't let me
navigate to the Category Description textbox or any other control on the form.
 
G

Guest

Nope, they're all created in design mode and I double-clicked the buttons to
create the code stubs for each of them. I'm not 100% certain, but I think it
may be related to something I've posted elsewhere in this newsgroup ... under
the "Can't navigate away from control" in
dotnet.framework.windowsforms.databinding.
 
V

VJ

I have theory knowledge of databinding, and have not used it that
extensively in real-time. It could, always event drive programming leads to
these situation.

Thanks
VJ
 

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

Top