I was creating a program that will add the value of the first 2 columns in datagridview when you typed it in then the answer will be displayed in the third column... I want to auto update the third column that if I delete the value of one of first two columns the third column will be affected.

Is it possible to update the value of a cell if it already has a value?

Recommended Answers

All 3 Replies

>I want to auto update the third column that if I delete the value of one of first two columns the third column will be affected.

Expression column.

Dim dt As New Data.DataTable
        dt.Columns.Add("No1", GetType(Int32))
        dt.Columns.Add("No2", GetType(Int32))
        dt.Columns.Add("Sum", GetType(Int32), "No1+No2")

        datagridView1.DataSource = dt

Thanks, it helps a lot ^_^

You're welcome.

Please mark this thread as solved if you have found an answer to your question and good luck!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.