使用c#.net 3.5填充多级下拉列表
问题描述:
嗨!
i希望填充多级下拉列表即
饮料
__SoftDrinks
____ SoftDrinks1
____SoftDrinks2
__其他饮料
食品
__快餐
____Burger
____Pizza
可以有人帮帮我。
谢谢
hi!
i want to populate a multi level dropdown list i.e
Drinks
__SoftDrinks
____SoftDrinks1
____SoftDrinks2
__OtherDrinks
Foods
__Fast Food
____Burger
____Pizza
Could anybody help me out.
Thanks
答
我认为您可以使用基于类别的不同缩进来解决此问题。
您可以在数据库级别或前端执行此操作。只需根据类别在每个项目前添加适当的空格。每当你需要下拉列表的Text / SelectedText,获取值,使用修剪
函数然后使用它。
希望这会有所帮助!
I think you can work around this using different indentation based on the category.
You can do this either at the database level or in the front end. Just add proper white-spaces before each item based on the category. Whenever you need the Text/SelectedText of the dropdownlist, get the value, useTrim
function and then use it.
Hope this helps!
看看这篇文章是否有帮助:
DropDown TreeView控件 [ ^ ]
带有ComboBox下拉节点的TreeView控件 [ ^ ]
Have a look at this article if it helps:
DropDown TreeView Control[^]
A TreeView Control with ComboBox Dropdown Nodes[^]
http://www.clientsideasp.net/2009/03/27/aspnet-tree-dropdownlist-listbox/ [ ^ ]
这是另一个链接可能有帮助。
http://www.clientsideasp.net/2009/03/27/aspnet-tree-dropdownlist-listbox/[^]
Here is another link might help.