Groups | Blog | Home
all groups > asp.net building controls > october 2006 >

asp.net building controls : ITemplate


Ben Schumacher
10/13/2006 2:01:00 PM
Ok smart guys and gals ...

I have a GridView control with a dynamically created checkbox column. The
checkbox is created using ITemplate interface. In my class that implements
the ITemplate interface I set the AutoPostBack property of the checkbox to
True. When the checkbox is clicked, I want to handle the CheckChanged event
of the checkbox on the webform (.aspx) that contains the GridView control.
I can easily use the addhandler instruction in the ITemplate interface class
to handle the CheckChanged event, but how do I bubble the event out to the
actual .aspx page that contains the gridview control????????????

I have been googling for hours. It seems no one has any idea how to do
this. I would be so incredibly grateful for any insight into my problem.

Ben

Teemu Keiski
10/13/2006 11:19:06 PM
See *.aspnet, replied on:
http://aspadvice.com/blogs/joteke/archive/2006/10/13/Command_2D00_capable-CheckBox-with-GridView.aspx


--
Teemu Keiski
ASP.NET MVP, AspInsider
Finland, EU
http://blogs.aspadvice.com/joteke

[quoted text, click to view]

Michael Hamrah
10/15/2006 12:33:24 PM
If this is something you're doing a lot of you may want to consider
Event Pooling. It creates an object that acts as a broker between
controls that raise events and controls that handle events, so you
don't need a direct reference to each one. It's kind of like a more
suped up version of event bubbling.

Here's an implementation that works well:

http://www.codeproject.com/csharp/EventPool.asp

Michael Hamrah

[quoted text, click to view]
AddThis Social Bookmark Button