使用c#.net 3.5填充多级下拉列表 [英] populate a multi level dropdown list using c# .net 3.5

查看:125
本文介绍了使用c#.net 3.5填充多级下拉列表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨!

i希望填充多级下拉列表即

饮料

__SoftDrinks

____ SoftDrinks1 < br $>
____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, use Trim 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.


这篇关于使用c#.net 3.5填充多级下拉列表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆