This is a migrated thread and some comments may be shown as answers.

[Solved] Eventhandling for Controls inside global node template

1 Answer 93 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
reinberger
Top achievements
Rank 2
reinberger asked on 09 Jan 2008, 01:35 PM
Hi there,

I couldn't find a way to hookup the eventhandlers for - controls inside the global node template. I already read the following post:

http://www.telerik.com/community/forums/thread/b311D-dgcba.aspx


But, from my understanding of the posting, the article refers to hookup to the event of a single LinkButton. In my scenario however, I have a global template and therefore, every node contains (in my case) three ImageButtons and each ImageButton in each node should fire an event.

I tried to hookup the events in the NodeDataBound eventhandler of the treeview like this:

((ImageButton) e.Node.FindControl("ibAddQuery")).Command += ibAddQuery_Click;

This command works and a (async) postback is also being raised, but the execution doesn't step into the eventhandler ibAddQuery_Click (btw, the name is misleading but the method signature is correct).

Could you point out what I am missing or propose another (better and working) solution?

Best regards
Thomas

1 Answer, 1 is accepted

Sort by
0
reinberger
Top achievements
Rank 2
answered on 09 Jan 2008, 01:56 PM
Eventually, I found the problem right now on my own.

If I use LinkButtons instead of ImageButtons, the eventhandling works quite fine.

Nevertheless I cannot explain why it doesn't work with ImageButtons but I think I can remember having had the same problem with Infragistics ASP.NET controls (a hint that will save you thousands of dollars: don't even take into consideration of using them! You'll bite your ass as I did).

Thomas
Tags
General Discussions
Asked by
reinberger
Top achievements
Rank 2
Answers by
reinberger
Top achievements
Rank 2
Share this question
or