复选框列表 [英] checkbox list

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

问题描述

谁能帮我解决问题.

正在使用checkboslist控件,其中选中复选框后将其保存在DB中,例如(checkboxvalue,checkboxvalue .........)
例如:(1,2,3,)

在尝试从数据库检索时
与``,''分开并在for循环中移动


for(int i = 0; i< GroupCodes.Length; i ++)
{
if(GroupCodes.Substring(i,1)!=,")
{
GroupTypeChkBxLst.SelectedValue = GroupCodes.Substring(i,1);

}
}

通过使用此最后一个值被选中,所有其他先前的值都取消选中

can any one help me to run out of problem.

am using checkboslist control in which after checking the check boxes am saving in DB like (checkboxvalue,checkboxvalue.........)
ex:(1,2,3,)

when am trying to retrive from dataBase
am seperating from '','' and moving round in for loop

Ex
for (int i = 0; i < GroupCodes.Length; i++)
{
if (GroupCodes.Substring(i,1) != ",")
{
GroupTypeChkBxLst.SelectedValue = GroupCodes.Substring(i, 1);

}
}

by using this last value is getting selected, all other previous values get unchecking

推荐答案

好,您需要更改代码并使用:
Checkboxlist.Items属性 [
Well, you need to change your code and use:
Checkboxlist.Items property[^]

In your for loop, if you find a particular checkboxlistitem saved as selected then do something like: checkboxlist1.Items[i].Selected


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

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