首页 > 其他 > 详细

绑定checkedComboBox

时间:2017-03-14 11:58:07      阅读:315      评论:0      收藏:0      [点我收藏+]

 

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 == null ? null : string.Join(",", value.ToArray()));
}
}

 

绑定checkedComboBox

原文:http://www.cnblogs.com/huzige/p/6547659.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!