if (MessageBox.Show("是否要删除选中的数据?", "提示....",MessageBoxButtons.YesNo) == DialogResult.Yes)
            {
                try
                {
                    listwire.RemoveAt(this.dataGridView1.CurrentCell.RowIndex);
                    //MessageBox.Show("删除成功");
                    this.dataGridView1 = null;
                    this.dataGridView1.DataSource = listwire; //在这句代码报的错
                }
                catch (Exception ex)
                {
                    
                    throw;
                }
               
            }错误:未将对象引用设置到对象的实例。异常