L
Lucifer
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=PostageGroups
OnSelectedIndexChanged="ddlGroupStatus_SelectedIndexChanged"
AutoPostBack="True" ' etc...
<ItemTemplate>
'my dropdown for picking the status
'of the items to be listed in
<asp:dropdownlist id=ItemStatus ...
</asp:dropdownlist>
'nested datalist
<asp:datalist id=PostageItems
'some more code...
</asp:datalist:asp>
</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.CommandEventHandler
Protected Overridable Sub OnCommand(ByVal e As
System.Web.UI.WebControls.CommandEventArgs, ByVal source As Object)
RaiseEvent Command(source, e)
RaiseBubbleEvent(source, e)
End Sub
Public Sub ddlGroupStatus_SelectedIndexChanged(ByVal sender As
Object, ByVal e As System.EventArgs)
OnCommand(New
System.Web.UI.WebControls.CommandEventArgs("DropDown", CType(sender,
DropDownList).SelectedValue), CType(sender, DropDownList))
End Sub
Private Sub PostageTypes_ItemCommand(ByVal source As Object,
ByVal e As System.Web.UI.WebControls.DataListCommandEventArgs) Handles
PostageTypes.ItemCommand
If e.CommandName = "DropDown" Then
Dim GroupID As Integer =
CType(CType(e.Item.FindControl("lblDeliveryGroupID"), Label).Text,
Integer)
Dim Status As Boolean =
CBool(CType(e.Item.FindControl("ddlGroupStatus"),
DropDownList).SelectedValue)
Dim myPostage As New Ecom_PostageDB
With CType(PostageTypes.FindControl("PostageList"),
DataList)
..SelectedIndex = -1
..DataSource =
myPostage.GetPostageItemsByStatusAndGroup(Status, GroupID)
..DataBind()
End With
End If
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=PostageGroups
OnSelectedIndexChanged="ddlGroupStatus_SelectedIndexChanged"
AutoPostBack="True" ' etc...
<ItemTemplate>
'my dropdown for picking the status
'of the items to be listed in
<asp:dropdownlist id=ItemStatus ...
</asp:dropdownlist>
'nested datalist
<asp:datalist id=PostageItems
'some more code...
</asp:datalist:asp>
</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.CommandEventHandler
Protected Overridable Sub OnCommand(ByVal e As
System.Web.UI.WebControls.CommandEventArgs, ByVal source As Object)
RaiseEvent Command(source, e)
RaiseBubbleEvent(source, e)
End Sub
Public Sub ddlGroupStatus_SelectedIndexChanged(ByVal sender As
Object, ByVal e As System.EventArgs)
OnCommand(New
System.Web.UI.WebControls.CommandEventArgs("DropDown", CType(sender,
DropDownList).SelectedValue), CType(sender, DropDownList))
End Sub
Private Sub PostageTypes_ItemCommand(ByVal source As Object,
ByVal e As System.Web.UI.WebControls.DataListCommandEventArgs) Handles
PostageTypes.ItemCommand
If e.CommandName = "DropDown" Then
Dim GroupID As Integer =
CType(CType(e.Item.FindControl("lblDeliveryGroupID"), Label).Text,
Integer)
Dim Status As Boolean =
CBool(CType(e.Item.FindControl("ddlGroupStatus"),
DropDownList).SelectedValue)
Dim myPostage As New Ecom_PostageDB
With CType(PostageTypes.FindControl("PostageList"),
DataList)
..SelectedIndex = -1
..DataSource =
myPostage.GetPostageItemsByStatusAndGroup(Status, GroupID)
..DataBind()
End With
End If