checklistboxx 多选取值 和选中

时间:2020-12-27 07:22:03
for (int i = 0; i < cklist.Items.Count; i++)
            {
                if (cklist.GetItemChecked(i))
                {
                  //修改子菜单的父节点为此菜单的id
                    BD008_Model model = new BD008_Model();
                   model.BD008_001 = ((BD001_Model)cklist.Items[i]).BD001_001 .ToString();
                    model.BD008_003 = currentid;
                    model.BD008_004 = txtsort.Text;
                    bll.Update(model);

                }
            }

  

 for (int i = 0; i < cklist.Items.Count; i++)
            {
                if (list.Where(m => m.BD001_001 == ((Model.BD001_Model)cklist.Items[i]).BD001_001).ToList().Count > 0)
                {
                    cklist.SetItemChecked(i, true);
                }
            }