all groups > asp.net datagrid control > october 2004 >
You're in the

asp.net datagrid control

group:

Getting control of Items within a Datalist


Getting control of Items within a Datalist ree32 NO[at]SPAM hotmail.com
10/5/2004 11:47:23 PM
asp.net datagrid control:
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.

Re: Getting control of Items within a Datalist ree32 NO[at]SPAM hotmail.com
10/6/2004 4:57:58 AM
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).

[quoted text, click to view]

Re: Getting control of Items within a Datalist Michael Tkachev
10/6/2004 2:58:55 PM
Label l = (Label)DataList.Items[e.Item.ItemIndex].Controls[CotrolNumber];

[quoted text, click to view]

AddThis Social Bookmark Button