Ask a Question related to ASP.NET Data Grid Control, Design and Development.
-
Nathan Sokalski #1
Event Bubbling From The HeaderTemplate
I have three LinkButtons in the HeaderTemplate of my DataList (I use them to
let the user determine what to sort the list by). I am assuming that the
event will be bubbled to the ItemCommand event (since that is the default
and I did not supply a CommandName). However, I need to determine which of
the three LinkButtons triggered the event. How can I do this? Thanks.
--
Nathan Sokalski
[email]njsokalski@hotmail.com[/email]
[url]http://www.nathansokalski.com/[/url]
Nathan Sokalski Guest
-
Event Bubbling Custom Object not inheriting from control
One of the new things flash flex and xaml have are ways which the event easily bubbles up to a parent that knows how to handle the event. Similar... -
Event Bubbling
Dear Folks, I have some issue with bubbling the event above two levels in the hierarch I have a web custom control 'B' . 'B' consists of a button... -
Bubbling Event in Composite controls
Hi Everyone, I am building a composite server control. I have defined an event for my child control with Custom Event Arguments. I am using the... -
Event Bubbling from a template
Hi, I have a template in a DataList. The template also contains a DataList. I'd like to bubble the OnItemCommand event from the template's... -
Bubbling Event ---- Problem!!!!
Mackarand, Is the user control being reloaded on post back? I'm doing exactly what you describe on my own web site. When I decided to go this... -
Brock Allen #2
Re: Event Bubbling From The HeaderTemplate
It's the 'sender' parameter in the event handler.
-Brock
DevelopMentor
[url]http://staff.develop.com/ballen[/url]
> I have three LinkButtons in the HeaderTemplate of my DataList (I use
> them to let the user determine what to sort the list by). I am
> assuming that the event will be bubbled to the ItemCommand event
> (since that is the default and I did not supply a CommandName).
> However, I need to determine which of the three LinkButtons triggered
> the event. How can I do this? Thanks.
>
Brock Allen Guest
-
Nathan Sokalski #3
Re: Event Bubbling From The HeaderTemplate
Sorry to burst your Event Bubble, but that is incorrect. First of all, the
ItemCommand uses "source", not "sender". Second, the value of "source" will
always be the DataList that the event was bubbled from, not the control that
triggered the event. One thing that I noticed, I haven't had time to look
into it yet, but while I was testing some other code of mine that uses event
bubbling, I noticed that in the Trace information there is a value (I don't
know if it's a variable or not) called __EVENTTARGET which has the value of
the control which triggered the event bubbling. If Trace can get at this
value, I was wondering if there might be a way to get at it through some
kind of system variable? If anyone knows anything about this, I would like
to know. Thanks.
--
Nathan Sokalski
[email]njsokalski@hotmail.com[/email]
[url]http://www.nathansokalski.com/[/url]
"Brock Allen" <ballen@NOSPAMdevelop.com> wrote in message
news:b8743b112a0388c78dad84c6a0f4@msnews.microsoft .com...> It's the 'sender' parameter in the event handler.
>
> -Brock
> DevelopMentor
> [url]http://staff.develop.com/ballen[/url]
>>>> I have three LinkButtons in the HeaderTemplate of my DataList (I use
>> them to let the user determine what to sort the list by). I am
>> assuming that the event will be bubbled to the ItemCommand event
>> (since that is the default and I did not supply a CommandName).
>> However, I need to determine which of the three LinkButtons triggered
>> the event. How can I do this? Thanks.
>>
>
Nathan Sokalski Guest
-
Scott Mitchell [MVP] #4
Re: Event Bubbling From The HeaderTemplate
Nathan Sokalski wrote:
Can't you set the ItemCommand for the LinkButtons? This will still> I have three LinkButtons in the HeaderTemplate of my DataList (I use them to
> let the user determine what to sort the list by). I am assuming that the
> event will be bubbled to the ItemCommand event (since that is the default
> and I did not supply a CommandName). However, I need to determine which of
> the three LinkButtons triggered the event. How can I do this? Thanks.
raise the DataList's ItemCommand event, and you can do:
If e.CommandName = "..." Then
...
ElseIf e.CommandName = "..." Then
...
ElseIf e.CommandName = "..." Then
...
End If
Where "..." is the ItemCommand values for the various LinkButtons.
--
Scott Mitchell [ASP.NET MVP]
[email]mitchell@4GuysFromRolla.com[/email]
[url]http://www.4GuysFromRolla.com/ScottMitchell[/url]
Scott Mitchell [MVP] Guest



Reply With Quote

