raise a bubble event.

Discussion in 'ASP .Net' started by Lucifer, Oct 13, 2004.

  1. Lucifer

    Lucifer Guest

    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
    Lucifer, Oct 13, 2004
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Lucifer

    raise a bubble event.

    Lucifer, Oct 13, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    4,336
    Scott Allen
    Oct 13, 2004
  2. Jacol

    raise or not to raise [Newbie]

    Jacol, Feb 3, 2007, in forum: Python
    Replies:
    5
    Views:
    398
    Gabriel Genellina
    Feb 5, 2007
  3. mlimber
    Replies:
    0
    Views:
    787
    mlimber
    Aug 5, 2008
  4. ernest
    Replies:
    2
    Views:
    276
    Roy Smith
    Nov 14, 2010
  5. Lucifer

    raise a bubble event.

    Lucifer, Oct 13, 2004, in forum: ASP .Net Web Controls
    Replies:
    0
    Views:
    95
    Lucifer
    Oct 13, 2004
Loading...

Share This Page