dev 表格添加复选框 ,可以勾选多行

 this.repositoryItemCheckEdit1.QueryCheckStateByValue += new DevExpress.XtraEditors.Controls.QueryCheckStateByValueEventHandler(re3_QueryCheckStateByValue);

//判断表格的数据勾选复选框

void re3_QueryCheckStateByValue(object sender, DevExpress.XtraEditors.Controls.QueryCheckStateByValueEventArgs e)
{
string val = "";
if (e.Value != null)
{
val = e.Value.ToString();
}
else
{
val = "False";//默认为选不中
}
switch (val)
{
case "True":
e.CheckState = CheckState.Checked;
break;
case "1":
e.CheckState = CheckState.Checked;
break;
case "0":
e.CheckState = CheckState.Unchecked;
break;
case "False":
e.CheckState = CheckState.Unchecked;
break;
}
e.Handled = true;
}

posted @ 2016-08-25 14:21  吃葡萄不吐葡萄脾  阅读(987)  评论(2编辑  收藏  举报