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();