Getting control of Items within a Datalist

R

ree32

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.
 
M

Michael Tkachev

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

ree32

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];
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,764
Messages
2,569,567
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top