DataGridView Real-time submission

Source: Internet
Author: User

A tool has been customized to perform other actions based on the values in DataGridView. When you modify a value in DataGridView and do other things directly,

The value in the result DataGridView is displayed as a, and the property of the operation is the unmodified value B.

According to the description of this article

http://blog.163.com/[email protected]/blog/static/22418624201098104916353/

According to the above description, the following modifications can be

winform DataGridView to submit the input in real time:
submits the table contents in the Currentcelldirtystatechanged event.
The code in the event is as follows:

if (this.dataGridView1.IsCurrentCellDirty)
             {
                 this.datagridview1.commitedit ( Datagridviewdataerrorcontexts.commit);
             }
Enter in DataGridView to trigger the Cellvaluechanged event in real time instead of triggering when the carriage return and focus leave

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.