This topic has been archived. It cannot be replied.
-
工作学习 / IT技术讨论 / ASP。NET问题, 谢谢!有没有哪位朋友在DATALIST中用过DROPDOWNLIST?把DROPDOWNLIST拖进DATALIST以后, 虽然有ID,但是在behind code中找不到这个DROPDOWNLIST的定义, 硬要用当然是找不到。假如要用的话, 数据如何才能绑定?
-henhen(哼哼@风起白沙忆江南);
2004-3-3
{190}
(#1630097@0)
-
自己到开头处根据id,定义一个不就行了?然后,再设datasource = your datalist.
-luoboyang(萝卜秧);
2004-3-3
(#1630112@0)
-
不是的,那个DATALIST是个container, 我想把dropdownlist做成它的子控件。
-henhen(哼哼@风起白沙忆江南);
2004-3-3
(#1630189@0)
-
不知道你想怎么用?
-templeliu(小河);
2004-3-12
{521}
(#1641289@0)
-
谢谢。偶的dropdownlist的数据源跟datalist不一起,只是根据datalist绑定数据中的某一个值来设定dropdownlist 中default选的值,就想试试直接这样是不是可行,不行的话用其它方法。
-henhen(哼哼--怎么办?);
2004-3-12
{162}
(#1642584@0)
-
建一个自己server control 代替DropDownList
-uniquemember(TjHong);
2004-3-12
{607}
(#1641869@0)
-
谢谢, 就是这样解决的。
-henhen(哼哼--怎么办?);
2004-3-12
(#1642586@0)
-
Use FindControl() method of container control, [DataList].FindControl(DrowDownListID)
-ijy4y4(Tommy);
2004-3-17
(#1649615@0)
-
Datalist isn't just a container control. It is a templated control. Can't use findcontrol() method to find control contained in template
-uniquemember(TjHong);
2004-3-18
(#1649816@0)
-
It works to use e.Item.FindControl at DataList.ItemDataBound event's handler.
-uniquemember(TjHong);
2004-3-18
(#1650599@0)
-
Yes, you are right. Should be e.Item.FindControl(), since the dropdownlist controls are repeating in Items. Can be any events passing e relate to item, like selectedIndexChanged.
-ijy4y4(Tommy);
2004-3-21
(#1653281@0)