嵌套的复选框列表 [英] nested checkbox list
本文介绍了嵌套的复选框列表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
你好,
我正在用C#开发一个项目,在该项目中我希望输出类似以下的内容.
Hello,
I am developing a project in c# in which i want the output some thing like this.
Category1
Subcategory1
Sub_Subcategory1 Sub_Subcategory2
Subcategory2
Sub_Subcategory1 Sub_Subcategory2
Category2
Category3
所有这些都必须使用动态checkboxlist
,
从数据库中填充
当我选择Sub_Subcategories
时,必须将其输入数据库.
如果我检查Category1,Subcategory1
和Subcategory2
已显示,如果我检查Subcategory1
,必须显示Sub_Subcategory1
和Sub_Subcategory2
.
请将代码发送给我.
请帮帮我.
非常紧急..
All this has to be populated from database by using dynamic checkboxlist
,
when i select Sub_Subcategories
it has to be entered into the database.
if i check Category1,Subcategory1
and Subcategory2
has to displayed, if I check Subcategory1
, Sub_Subcategory1
and Sub_Subcategory2
has to be displayed.
Please send me the code.
Please help me.
its very urgent..
推荐答案
请参阅我对问题的评论.一旦您没有指定应用程序应为哪种应用程序,就不可能给出明确的答案.
但是一般的想法是这样的:一谈到嵌套列表,这应该是更通用的结构,即复选框树".您始终可以拥有或创建一个控件来实现这种结构的视图.例如,如果使用System.Windows.Forms
,则可以使用类System.Windows.Forms.TreeView
,该类在树节点旁边可以具有复选框:
http://msdn.microsoft.com/en-us/library/system. windows.forms.treeview.aspx [ ^ ],
http://msdn.microsoft.com/en-us/library/system.windows.forms.treeview.checkboxes.aspx [ ^ ].
—SA
Please see my comment to the question. As soon as you did not specify what kind of application your application should be, it''s not possible to give you a definitive answer.
But the general idea is this: as soon as you speak of nested lists, this should be more general structure, a "checkbox tree". You can always have or create a control implementing a view of such structure. For example, if you useSystem.Windows.Forms
, you can use the classSystem.Windows.Forms.TreeView
which can have check boxes next to the tree nodes:
http://msdn.microsoft.com/en-us/library/system.windows.forms.treeview.aspx[^],
http://msdn.microsoft.com/en-us/library/system.windows.forms.treeview.checkboxes.aspx[^].
—SA
感谢我的提出.我自己解决了.
谢谢
thanks for baring me. I solved by myself.
Thanks
这篇关于嵌套的复选框列表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文