473,657 Members | 2,478 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

raise a bubble event.

Hi

I am trying to raise a bubble event.

I have a dropdownlist and a datalist in a datalist.

I want to use the postback from the dropdownlist to rebind the nested
datalist. But i need the event to be a datalist Command so i have
access to e.item for the main datalist

the aspx code

<asp:datalist id=PostageGroup s
OnSelectedIndex Changed="ddlGro upStatus_Select edIndexChanged"
AutoPostBack="T rue" ' etc...
<ItemTemplate >
'my dropdown for picking the status
'of the items to be listed in
<asp:dropdownli st id=ItemStatus ...
</asp:dropdownlis t>
'nested datalist
<asp:datalist id=PostageItems
'some more code...
</asp:datalist:as p>
</ItemTemplate>
</asp:datalist>

i am trying to catch the datalist PostageGroups postback for the
dropdownlist ItemStatus so i can rebind the rested datalist

the aspx.vb code:

Public Event Command As
System.Web.UI.W ebControls.Comm andEventHandler

Protected Overridable Sub OnCommand(ByVal e As
System.Web.UI.W ebControls.Comm andEventArgs, ByVal source As Object)

RaiseEvent Command(source, e)

RaiseBubbleEven t(source, e)

End Sub

Public Sub ddlGroupStatus_ SelectedIndexCh anged(ByVal sender As
Object, ByVal e As System.EventArg s)

OnCommand(New
System.Web.UI.W ebControls.Comm andEventArgs("D ropDown", CType(sender,
DropDownList).S electedValue), CType(sender, DropDownList))

End Sub

Private Sub PostageTypes_It emCommand(ByVal source As Object,
ByVal e As System.Web.UI.W ebControls.Data ListCommandEven tArgs) Handles
PostageTypes.It emCommand

If e.CommandName = "DropDown" Then

Dim GroupID As Integer =
CType(CType(e.I tem.FindControl ("lblDeliveryGr oupID"), Label).Text,
Integer)
Dim Status As Boolean =
CBool(CType(e.I tem.FindControl ("ddlGroupStatu s"),
DropDownList).S electedValue)
Dim myPostage As New Ecom_PostageDB

With CType(PostageTy pes.FindControl ("PostageList") ,
DataList)
..SelectedIndex = -1
..DataSource =
myPostage.GetPo stageItemsBySta tusAndGroup(Sta tus, GroupID)
..DataBind()
End With

End If

Nov 18 '05 #1
1 4369
Hi Lucifer,

When the DropDownList fires a SelectIndexchan ged event, the sender
parameter in the event handler will represent the DropDownList. You
can use the Parent property of the DropDownList to get back to the
DataListItem, and from there grab the nested DataList (perhaps with
FindControl).

I have two articles that could help you. They deal with DataGrid and
Repeaters, but the approach is the same.

DropDownList Controls In an ASP.Net DataGrid
http://odetocode.com/Articles/231.aspx

In Search Of ASP.NET Controls
http://www.odetocode.com/Articles/116.aspx

HTH,

--
Scott
http://www.OdeToCode.com/blogs/scott/

On 13 Oct 2004 07:34:13 -0700, "Lucifer" <rs******@zethi cs.com> wrote:
Hi

I am trying to raise a bubble event.

I have a dropdownlist and a datalist in a datalist.

I want to use the postback from the dropdownlist to rebind the nested
datalist. But i need the event to be a datalist Command so i have
access to e.item for the main datalist

the aspx code

<asp:datalis t id=PostageGroup s
OnSelectedInde xChanged="ddlGr oupStatus_Selec tedIndexChanged "
AutoPostBack=" True" ' etc...
<ItemTemplat e>
'my dropdown for picking the status
'of the items to be listed in
<asp:dropdownl ist id=ItemStatus ...
</asp:dropdownlis t>
'nested datalist
<asp:datalis t id=PostageItems
'some more code...
</asp:datalist:as p>
</ItemTemplate>
</asp:datalist>

i am trying to catch the datalist PostageGroups postback for the
dropdownlist ItemStatus so i can rebind the rested datalist

the aspx.vb code:

Public Event Command As
System.Web.UI. WebControls.Com mandEventHandle r

Protected Overridable Sub OnCommand(ByVal e As
System.Web.UI. WebControls.Com mandEventArgs, ByVal source As Object)

RaiseEvent Command(source, e)

RaiseBubbleEve nt(source, e)

End Sub

Public Sub ddlGroupStatus_ SelectedIndexCh anged(ByVal sender As
Object, ByVal e As System.EventArg s)

OnCommand(Ne w
System.Web.UI. WebControls.Com mandEventArgs(" DropDown", CType(sender,
DropDownList). SelectedValue), CType(sender, DropDownList))

End Sub

Private Sub PostageTypes_It emCommand(ByVal source As Object,
ByVal e As System.Web.UI.W ebControls.Data ListCommandEven tArgs) Handles
PostageTypes.I temCommand

If e.CommandName = "DropDown" Then

Dim GroupID As Integer =
CType(CType(e. Item.FindContro l("lblDeliveryG roupID"), Label).Text,
Integer)
Dim Status As Boolean =
CBool(CType(e. Item.FindContro l("ddlGroupStat us"),
DropDownList). SelectedValue)
Dim myPostage As New Ecom_PostageDB

With CType(PostageTy pes.FindControl ("PostageList") ,
DataList)
.SelectedInd ex = -1
.DataSource =
myPostage.GetP ostageItemsBySt atusAndGroup(St atus, GroupID)
.DataBind()
End With

End If


Nov 18 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
321
by: Lucifer | last post by:
Hi I am trying to raise a bubble event. I have a dropdownlist and a datalist in a datalist. I want to use the postback from the dropdownlist to rebind the nested datalist. But i need the event to be a datalist Command so i have access to e.item for the main datalist
0
973
by: Lucifer | last post by:
Hi I am trying to raise a bubble event. I have a dropdownlist and a datalist in a datalist. I want to use the postback from the dropdownlist to rebind the nested datalist. But i need the event to be a datalist Command so i have access to e.item for the main datalist
5
2006
by: Mike | last post by:
Hi group; Let say I have an object called Account, that raises an event called AccountLow with its owns EventArgs, and when this event gets raised, I will like to raise another custom event called AccountGotLowAmount and passes AccountLow’s EventArgs along with the new event.
0
1068
by: shapper | last post by:
Hello, I have a few custom controls organized as follows: Parent Child Section User User control raises an event named Updated. This event has custom arguments of type UpdatedEventArgs.
0
8420
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8324
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8740
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8516
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8617
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7353
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5642
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4330
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2743
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.