ListView中的DropDownList数据绑定问题?

来源:百度知道 编辑:UC知道 时间:2024/05/31 22:17:16
ListView中的DropDownList数据绑定问题?
ListView外有一个TextBox,其ListView中的DropDownList数据的绑定条件是根据TextBox里的值来查询LINQ语句,再做绑定
我想这样实现,即TextBox数据值后,ListView中的DropDownList显示相应的数据?怎么做?

希望有人指导我

手动检索TextBox中的数值,再依据该数值从数据库中查出数据并绑定到dropdownlist中:
textbox中的数据有变化时,就遍历一次textbox中的数据,
用一个datatable存储textbox中的数据,再把检索值绑定到listview中在Item数据绑定事件里手动绑定数据,再在listview的数据绑定事件中检索该项的检索值,依据它查询,绑定dropdownlist

listview主要代码部分termId:检索值;termName:检索值名;DropDownList :要绑定的数据
<ItemTemplate>

<td id="Td1" runat="server">
<asp:Label ID="termNameLabel" runat="server" Text='<%# Eval("termName") %>' />
<asp:Label ID="termIdLabel" runat="server" Text='<%# Eval("termId") %>' Visible="False" />
<br />
<asp:DropDownList ID="termDropDownList" runat="server" Width="100%" AutoPostBack="