DataGridCommand does not bubble?

S

Sergio Florez M.

I'm creating a control which has a Button and a DataGrid among other things.
I have overwritten the OnBubbleEvent() method to capture the Button's click
event and it works fine. I also want to do this to capture a click on a
ButtonColumn in the grid, but OnBubbleEvent() is never fired when I click
the ButtonColumn in the grid. How do I work around this?
 
S

Scott Mitchell [MVP]

Sergio said:
I'm creating a control which has a Button and a DataGrid among other things.
I have overwritten the OnBubbleEvent() method to capture the Button's click
event and it works fine. I also want to do this to capture a click on a
ButtonColumn in the grid, but OnBubbleEvent() is never fired when I click
the ButtonColumn in the grid. How do I work around this?

Can you just handle it by creating an event handler for the DataGrid's
ItemCommand event? This is the event that's raised when a button in the
DataGrid - be it in a ButtonColumn, TemplateColumn, or anywhere else in
the DataGrid - is clicked.

--

Scott Mitchell
(e-mail address removed)
http://www.4GuysFromRolla.com

* When you think ASP.NET, think 4GuysFromRolla.com!
 
S

Sergio Florez M.

Works perfect, thank you. But this leaves me thinking. Why is there an
OnBubbleEvent() that only captures the events the childs decide to bubble up
and that we have to manage in a very manual way if we can simply create
event handlers for every event, bubbled or not bubbled?
 

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

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,904
Latest member
HealthyVisionsCBDPrice

Latest Threads

Top