DialogResult dr = MessageBox.Show("确认删除记录吗?", "提示", MessageBoxButtons.YesNo);
            if (dr == DialogResult.Yes)
            {
                DataSet deleRcom2 = Collections.FastSocket.get_ds("select o.id,b.dd_size,b.size_long,b.size_wide,b.size_high,o.goodsType,o.cname,o.pay_type,o.order_memo,o.address,o.RecipientCode,o.mobile,o.country_free,o.agencyFund,o.order_code,o.cforhmType,b.goods,b.kd_billcode,b.dd_weight,b.dd_weight2,b.member_id,b.username,b.goodsTyep goodsType2  from pmw_order o left join pmw_billcode b on o.order_code=b.order_code where isnull(o.DoubleCheck,0)=1 and isnull(b.lost_flag,0)=0 and isnull(b.is_outplace,0)=1 and  isnull(is_packed,0)=0 and isnull(packed_billcode,'')='' and o.order_code='" + this.tool_order_code.Text + "' and b.kd_billcode='" + e.Row.Cells["kd_billcode2"].Value + "'");
                if (deleRcom2 != null && deleRcom2.Tables.Count > 0 && deleRcom2.Tables[0].Rows.Count > 0)
                {

                    DataTable dt1 = (DataTable)rcomdgv1.DataSource;
                    DataRow drcalc = dt1.NewRow();
                    drcalc.ItemArray = deleRcom2.Tables[0].Rows[0].ItemArray;
                    dt1.Rows.Add(drcalc);
                    rcomdgv1.DataSource = dt1;
                }
                else
                {
                    MessageBox.Show("无法获取该数据");
                    e.Cancel = true;
                }
            }
            else
            {
                e.Cancel = true;
            }

C# DataGridView 的UserDeletingRow事件,删除的更多相关文章

  1. DataGridView的Validating事件注册后删除操作的处理

    我们在处理DataGridView必填项判断时,一般使用DataGridView的RowValidating事件判断,具体代码如下: protected override void OnRowVali ...

  2. DataGridView上下键事件获取到的是上次停留行的内容

    DataGridView上下键事件 在DataGridView中,通过上下键将选中行的内容返回, 问题: 通过上边的方法总是获取到上次停留行的内容,不是当前选中行的内容. winform的项目,使用C ...

  3. DataGridView的Cell事件的先后触发顺序

    最近正在使用“DataGridView”对一个旧的Vs 2003开发的WINDOWS应用程序进行改造. 发现Vs 2003中的"DataGrid"中的一些事件已经在新的控件Data ...

  4. DataGridView属性和事件

    //注册绑定事件 private void dgvBidFile_EditingControlShowing(object sender, DataGridViewEditingControlShow ...

  5. DataGridView绑定数据、删除数据

    定义学生类: using System; using System.Collections.Generic; using System.Linq; using System.Text; using S ...

  6. DataGridView 些许事件测试

    原始设计需求:当单元格内容是空白时,鼠标进入之后,显示一些数据 直观的第一感觉必然是用CellClick,细想,如果用户不用鼠标,直接按Tab键切换单元格呢?又或者,用户直接双击涅~ 主要测试的是:  ...

  7. C# DataGridView中DataGridViewComboBoxCell列,下拉框事件的处理【完美解决】

    http://blog.csdn.net/a312100321/article/details/25195311 问题:DataGridView绑定数据源之后,有一列需要用下拉框DataGridVie ...

  8. 给datagridview的下拉框添加valueChange事件

    修改datagridview的EditMode属性为EdutOnEnter,否则需要点2次以上才出现下拉框 1.给DataGridView添加EditingControlShowing事件: 2.编辑 ...

  9. 将listBox中信息显示在dataGridview中,操作datagridview后删除listBox信息和SQL数据库信息 续(浅谈listBox..)

    应用场景      对datagridview控件使用了解,以及操作datagridview选中的信息删除,并且有二次确认后才删除用户信息.相应的删除listbox中用户信息,下面一起看看需要哪些准备 ...

随机推荐

  1. 来个Button看一看

    0.目录 1.前言 2.基本属性与方法 3.点点更健康 4.我的Button有点多 5.震惊!TextView竟然... 1.前言 每次写代码总会忘记一些东西,又要重新Goooooooooogle,好 ...

  2. Hadoop介绍和环境配置

    原文:http://www.cnblogs.com/edisonchou/ 一.Hadoop的发展历史 说到Hadoop的起源,不得不说到一个传奇的IT公司-全球IT技术的引领者Google.Goog ...

  3. hdu1181 变形课(vector容器+dfs)

    变形课 Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 131072/65536 K (Java/Others) Total Submi ...

  4. 如何做更好的Android驱动project师

        随着智能手机的飞跃发展,特别是Android智能机的爆炸性发展,Android驱动project师是越来越受欢迎的一个职位,并且是一个非常值得人期待的职位,由于可能你參与研发的一款手机就能改变 ...

  5. java注解细节

    现在很多框架都使用注解了,典型的像Spring里面就可以看到大量的注解,比如@Service,@Controller这一类的都是注解.注解Annotation是java一项很重要的功能.下面就来整理一 ...

  6. 自学Python3.3-字符串格式化 作用域 递归

    一.字符串格式化 二.作用域 三.递归

  7. 如何在Intellij IDEA中拉svn分支?

    由于用IDEA时间也不是特别长,对操作svn的一些东西,不是特别熟悉,特此记录一下,以做备忘. 先说下流程: 在IDEA里面对trunk代码拉分支熟悉了,其实很容易, (1)你trunk目录下的得有个 ...

  8. Springboot 之 解决IDEA读取properties配置文件的中文乱码问题

    问题描述 当在.properties的配置文件中有中文时,读取出来的总是乱码.比如我的application.properties配置文件的内容如下: server.port=9090 test.ms ...

  9. iOS自定义文字高度添加行间距

    p.p1 { margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; color: #000000 } span.s1 { } span.s2 { c ...

  10. PXE搭建

    前提最好是防火墙规则-F,关闭,selinux 是disable 这个在以后更新linux系统的时候还可以在这个基础上再次增加可以一体化安装的系统. 1.用yum来安装所需要的软件包,先来搭建yum光 ...