首页 > 代码库 > 绑定checkedComboBox
绑定checkedComboBox
using System;
namespace CommonLib
{
/// <summary>
/// CommonCode 的摘要说明。
/// </summary>
[Serializable]
public class CommonCode
{
private string m_ID = string.Empty;
private string m_Name = string.Empty;
/// <summary>
/// 代码
/// </summary>
///
public CommonCode()
{
}
public CommonCode(string id,string name)
{
this.m_ID = id;
this.m_Name = name;
}
public string ID
{
get{return this.m_ID;}
set{this.m_ID = value;}
}
/// <summary>
/// 名称
/// </summary>
public string Name
{
get{return this.m_Name;}
set{this.m_Name = value;}
}
}
}
public void SetStatusList(List<CommonCode> commonCodes)
{
checkedComboBoxEdit1.Properties.Items.Clear();
LookupEditSetter.Setup(checkedComboBoxEdit1, commonCodes.ToArray(), true);
}
//获取值方法
public List<string> Status
{
get
{
var v = CanHelper.ob2Str(checkedComboBoxEdit1.EditValue);
if (string.IsNullOrEmpty(v)) return null;
var list = v.Split(‘,‘);
return list.ToList();
}
set
{
checkedComboBoxEdit1.SetEditValue(value =http://www.mamicode.com/= null ? null : string.Join(",", value.ToArray()));
}
}
绑定checkedComboBox