从树视图中检索值 [英] Retrieving Values from a Treeview

查看:83
本文介绍了从树视图中检索值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我将尝试解释我要真正快速地做些什么,然后继续讨论男性主题.我有403个潜在复选框,用户可以选择这些复选框来请求访问潜在的软件功能.因此,为了解决这个问题,我创建了多个具有所有可能性的树视图.如下所示的示例之一:

I am going to attempt to explain what I am trying to do real quick and then go on to the man subject. I have 403 potential checkboxes that a user can select to request access for a potential software function. So to solve this I created multiple treeviews that have all the possibilities. Example of one of many shown below:

<asp:TreeNode Text="ABC" Value="ABC">
                    <asp:TreeNode ShowCheckBox="True" Text="ARL" Value="ARL" />
                    <asp:TreeNode ShowCheckBox="True" Text="ARL_R" Value="ARL_R" />
                    <asp:TreeNode ShowCheckBox="True" Text="ARL_F" Value="ARL_F" />
                    <asp:TreeNode ShowCheckBox="True" Text="CLE" Value="CLE" />
                    <asp:TreeNode ShowCheckBox="True" Text="FWE" Value="FWE" />
                    <asp:TreeNode ShowCheckBox="True" Text="FWE_R" Value="FWE_R" />
                    <asp:TreeNode ShowCheckBox="True" Text="FWE_F" Value="FWE_F" />
</asp:TreeNode>



然后,用户从一系列树视图中选择他选择的每个节点.从技术上讲,我遇到的问题更多是存储问题.然后,我将检查用户选择的所有节点,并将它们推向sql数据库中的表.该数据库存储简单的字段,例如:姓,名,身份证号,主管电子邮件等.我尝试使用的字段之一是访问"字段,该字段存储用户选择的所有复选框,但如果用户选择您可以想象到403个选项,将诸如arl,arl_r等值折叠成另一个字符串时,看起来会很可怕.有没有更简单的方法来存储树视图中的值并知道它们来自何处?例如,如果他选择ARL,我是否可以做某种类型的二进制数学运算,说他是否切换了8位数字的第一位即arl?首先使用Treeviews可能会走得很远.



The user then selects each node he choices from the series of treeviews. The problem I''m having is technically more of a storage issue. I will then check all the nodes the user has selected and push them towards a table in an sql database. The database stores simple fields such as: last name, first name, id number, supervisor email, etc. One of the fields I am trying to utilize is the "access" field which stores all the checkboxes that the user selected but if he selects 403 options you can imagine that would look horrible with values such as arl, arl_r, and etc collapsed into another string. Is there an easier way to store values from a treeview and know where they came from? For example if he selects ARL, could I not do some type of binary math saying that if he toggled arl that is the first bit of an 8-bit number? I may be even far off the path by using Treeviews to begin with.

推荐答案

我首先要说的是重新设计您的体系结构和显示. 403选项太多,无法合理使用.如果我看到一个应用程序包含这么多复选框,我会迅速删除它们,然后去做一些不太复杂的事情,做同样的事情.

是的,您可以使用整数来存储代表所选值的位标志.但是,再次,您将有太多的值使其无法使用.
The first I would say is to redesign your architecture and display. 403 options is far too many to be reasonably usable. If I see an application with that many checkboxes I''ll delete, quickly, and go for something less complex that does the same thing.

Yes you can use an integer to store the bit flags that represent the selected values. However, once again, you will have too many values to make it usable.


这篇关于从树视图中检索值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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