本文介绍了无法在一个以下执行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 datagridview 中提交了列按钮,但代码没有执行。



i想要编辑或更新对于某些列,但我不知道如何编写代码。



i尝试如下,但代码没有执行。



我尝试了什么:



i have Submit column button in datagridview but code is not executing.

i want to edit or update for some columns but i don't how to write the code for that.

i tried as below but code is not executing.

What I have tried:

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace updatebuttoninDG
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            if(dataGridView1.Columns[e.ColumnIndex].Name == "Submit")
            {
                MessageBox.Show("Comments Submitted", "Message", MessageBoxButtons.OK, MessageBoxIcon.Information);
                customersBindingSource.Insert(4,Submit);
            }
        }

        private void Form1_Load(object sender, EventArgs e)
        {
            // TODO: This line of code loads data into the 'savedata.Customers' table. You can move, or remove it, as needed.
            this.customersTableAdapter.Fill(this.savedata.Customers);

        }
    }
}

推荐答案


这篇关于无法在一个以下执行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-30 17:51