c# dataGridview的Cellclick移除事件

时间:2014-02-12 18:19:34   收藏:0   阅读:480
bubuko.com,布布扣
        private void gvMoldInfo_CellClick(object sender, DataGridViewCellEventArgs e)
        {
            if (e.RowIndex < 1)
                return;

            string colName = gvMoldInfo.Columns[e.ColumnIndex].Name;
            if (colName != colRemove.Name)
                return;

            clsBarcodeMold rec = gvMoldInfo.Rows[e.RowIndex].DataBoundItem as clsBarcodeMold;
            if (rec == null)
                return;

            list.Remove(rec);
            BindGridView();
        }
bubuko.com,布布扣

 

以上为某dataGridview的cellclick的移除事件,挺好用的,下面为dataGridview的“移除”按钮样式常用设置,注意红框内的意义。

bubuko.com,布布扣

原文:http://www.cnblogs.com/seasons1987/p/3545457.html

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!