DevExpress下拉多选框CheckedComboBoxEdit赋值和设置默认值

来源:互联网 发布:数据还原 编辑:程序博客网 时间:2024/05/22 01:41


1、赋值:

IList<DictDetailVo> listCustomerType = ComponentsFactory.Instance.getDictService().QueryDictDetails(dictBoCustomerType);
          
            this.chkCustomerTypeQuery.Properties.Items.Clear();
          
            CheckedListBoxItem[] itemListQuery = new CheckedListBoxItem[listCustomerType.Count + 1];
          
            itemListQuery[0] = new CheckedListBoxItem("全部", "全部");
            int check = 1;
            foreach (DictDetailVo det in listCustomerType)
            {
                itemListQuery[check] = new CheckedListBoxItem(det.DictDetailCode, det.DictDetailName);
                check++;
            }
            this.chkCustomerTypeQuery.Properties.Items.AddRange(itemListQuery);

2、设置默认值:
            this.chkCustomerTypeQuery.EditValue = "全部";//查询界面默认选中全部
            this.chkCustomerTypeQuery.RefreshEditValue();

0 0
原创粉丝点击