码迷,mamicode.com
首页 > 其他好文 > 详细

DEV 实现CheckBox单选

时间:2018-12-11 16:00:04      阅读:231      评论:0      收藏:0      [点我收藏+]

标签:sele   res   tar   false   var   where   obj   实现   load   

废话不说,直接上代码

        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单选

标签:sele   res   tar   false   var   where   obj   实现   load   

原文地址:https://www.cnblogs.com/qzxj/p/10102103.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!