DEV 实现CheckBox单选
Posted qzxj
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了DEV 实现CheckBox单选相关的知识,希望对你有一定的参考价值。
废话不说,直接上代码
private void Frm_JHGL_CJMK_MLBW_Load(object sender, EventArgs e) { hs.Clear(); repositoryItemCheckEdit1.CheckedChanged += RepositoryItemCheckEdit1_CheckedChanged; } private void RepositoryItemCheckEdit1_CheckedChanged(object sender, EventArgs e) { CheckEdit pCheckEdit = sender as CheckEdit; if (pCheckEdit.Checked) { MLXXViewModel row = (MLXXViewModel)this.gridView_bwxx.GetRow(this.gridView_bwxx.GetSelectedRows()[0]); var List = grid_MLBWXX.DataSource as MLXXViewModel[]; foreach (var temp in List) { if (条件) { temp.Check = true; hs.Add(CJMK_MLXX); } else { var RemoveData = hs.Where(条件).FirstOrDefault(); if (RemoveData != null) { hs.Remove(RemoveData); } temp.Check = false; } } } gridView_bwxx.RefreshData(); }
以上是关于DEV 实现CheckBox单选的主要内容,如果未能解决你的问题,请参考以下文章