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 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 This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
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
|
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
|
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.
|
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.
|
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...
| |
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,...
|
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...
|
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,...
|
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...
|
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...
|
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();...
| |
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
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
| |