楠影

  博客园 :: 首页 :: 新随笔 :: 联系 :: 订阅 :: 管理 ::
Int32 type = 0;       
        foreach (ListItem li in this.chklProjType.Items)
        {
            if(li.Selected)
                type += Int32.Parse(li.Value);
        }
        if(type != 0)
            sbStr.Append(" and PROJ_TYPE & "+type+" > 0");


//checkboxlist选中                       
        byte[] bits = BitConverter.GetBytes(System.Convert.ToInt16(entilyProdCons.ProjType.ToString()));
        BitArray bitsProjType = new BitArray(bits);

        for (int i = 0; i < this.chklProjType.Items.Count; i++)
        {
            ListItem li = this.chklProjType.Items[i];
            li.Selected = bitsProjType[i];
        }

posted on 2008-04-17 23:31  楠影  阅读(222)  评论(1)    收藏  举报