Getting control of Items within a Datalist

Discussion in 'ASP .Net Datagrid Control' started by ree32, Oct 6, 2004.

  1. ree32

    ree32 Guest

    I have a problem as I have placed a dropdownlist in a datalist.

    Whenever the selected index changes I need to change a label inside
    the datalist.

    The problem is I can't get control of the label.

    When dropdownlist changes it goes to a function with args of
    systemEvent than a DataListItemEventArgs so I have no way getting
    control of the item in the datalist to change the label.

    Can someone please help me.
    ree32, Oct 6, 2004
    #1
    1. Advertising

  2. Label l = (Label)DataList.Items[e.Item.ItemIndex].Controls[CotrolNumber];

    "ree32" <> wrote in message
    news:...
    > I have a problem as I have placed a dropdownlist in a datalist.
    >
    > Whenever the selected index changes I need to change a label inside
    > the datalist.
    >
    > The problem is I can't get control of the label.
    >
    > When dropdownlist changes it goes to a function with args of
    > systemEvent than a DataListItemEventArgs so I have no way getting
    > control of the item in the datalist to change the label.
    >
    > Can someone please help me.
    Michael Tkachev, Oct 6, 2004
    #2
    1. Advertising

  3. ree32

    ree32 Guest

    Thanks for your help but I was wondering where do I get the control
    number?
    Also the e.Item.Index how will it work outside the a datalist command
    as the eventargs passed in aren't DataListItemEventArgs, but EventArgs
    (since its responding to a change in the dropdownlist).

    >>Re: Getting control of Items within a Datalist
    >>From: Michael Tkachev
    >>Date Posted: 10/6/2004 5:37:00 AM


    >>Label l = (Label)DataList.Items[e.Item.ItemIndex].Controls[CotrolNumber];
    ree32, Oct 6, 2004
    #3
    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. Nevyn Twyll
    Replies:
    8
    Views:
    1,865
  2. DC Gringo
    Replies:
    0
    Views:
    301
    DC Gringo
    Sep 15, 2004
  3. DC Gringo

    controls getting values from another control---within a control

    DC Gringo, Sep 15, 2004, in forum: ASP .Net Building Controls
    Replies:
    1
    Views:
    108
    Martin Dechev
    Sep 16, 2004
  4. DC Gringo
    Replies:
    1
    Views:
    104
    Martin Dechev
    Sep 16, 2004
  5. Will

    Problem with DataList within DataList

    Will, Oct 10, 2007, in forum: ASP .Net Web Controls
    Replies:
    4
    Views:
    187
    Walter Wang [MSFT]
    Oct 18, 2007
Loading...

Share This Page