带有复选框的数据列表 [英] Datalist with checkboxes

查看:84
本文介绍了带有复选框的数据列表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我有一个要求.我有一个必须显示的表格,公司名称和子类别将与复选框一起显示.

当用户要搜索其公司名称时,该公司名称将被显示.子类别也将与复选框一起显示.

我的要求是用户已经在公司中发布了几个子类别.当用户要编辑公司详细信息时,将根据复选框显示基于类别的所有子类别.

我收到带有子类别名称的复选框,我的要求是已经选择了子类别将被选中,而其他则未选中,以供用户理解.

请帮帮我.

在此先感谢.

Hi All,

I have a requirement.I have a form which has to be dispaly company name and subcategories will be dispalyed with checkboxes.

when user wants to search his company name then that company name,category will be dispalyed.subcategories also will be displayed with check boxes.

My requirement is already user has posted his company with several subcategories.when user wants to edit his company details all subcategories based on category will be dispalyed with checkboxes.

I am getting checkboxes with subcategorynames my requirement is already selected subcategories will be checked and otheres are unchecked for user understanding.

please help me.

Thanks in Advance.

推荐答案

http://forums.asp .net/t/1311324.aspx [ ^ ]

希望以上信息对您有所帮助.
http://forums.asp.net/t/1311324.aspx[^]

I hope the above information will be helpful.


已经选择了我的要求,子类别将被选中,而其他复选框则未被选中以便用户理解

检查样本并相应地进行操作.
my requirement is already selected subcategories will be checked and otheres are unchecked for user understanding

Check the sample and work accordingly.
foreach (DataListItem dli in DataList1.Items)
            {
                CheckBox ck = (CheckBox)dli.FindControl("ChkBox");
                Label lbl = (Label)dli.FindControl("Label1");
                {
                 //ChildString is the retrieved value of the checkbox (text here) saved in database.
                    if (ck.Text == ChildString)
                    {
                        ck.Checked = true;
                    }
                    else
                    {//do something.
                    }
                }


这篇关于带有复选框的数据列表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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