RT
我有一个数组,string str[2]="{0},{1}";
CheckBoxList中的选项:0,1,2(3项)
现在我想给这个CheckBoxList赋初值,当str和CheckBoxList中的选项有同一值的时候,此CheckBoxList项被勾选

解决方案 »

  1.   

    string str = "空调 水";
            Regex regex = new Regex(" ");
            string[] newstr = regex.Split(str);
            for (int n = 0; n < newstr.Length; n++)
            {
                for (int i = 0; i < BFixing.Items.Count; i++)
                {
                    if (BFixing.Items[i].Value == newstr[n])
                    {
                        BFixing.Items[i].Selected = true;
                    }
                }
            }
    我时这么做的 但是总是初始化不了,郁闷
      

  2.   

    string[]   newstr   =   str.Split(regex); 
      

  3.   

    Regex   regex   =   new   Regex(@" ");