码迷,mamicode.com
首页 > 其他好文 > 详细

如何获取checkboxlist的多个选中项

时间:2015-01-28 14:31:38      阅读:136      评论:0      收藏:0      [点我收藏+]

标签:

                string[] array = dt.Rows[0]["s_type"].ToString().Split(‘|‘);
                foreach (ListItem m in cb_type.Items)
                {
                    for (int i = 0; i < array.Length; i++)
                    {
                        if (m.Value == array[i])
                        {
                            m.Selected = true;
                        }
                    }
                }
                string[] strTerms = dt.Rows[0]["s_zhandian"].ToString().Split(‘|‘);
                foreach (ListItem lItem in CB_zhandian.Items)
                {
                    for (int i = 0; i < strTerms.Length; i++)
                    {
                        if (lItem.Value == strTerms[i])
                        {
                            lItem.Selected = true;
                        }
                    }
                }

如何获取checkboxlist的多个选中项

标签:

原文地址:http://www.cnblogs.com/candyzhmm/p/4255550.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!