Example of EditingControlShowing event usage of datagridview in C#
This article describes the usage of EditingControlShowing event of datagridview in C#. Share it for your reference. The specific implementation method is as follows:
using System; using ; using ; using ; using ; using ; using ; using datagridview1.DataSet1TableAdapters; namespace datagridview1 { public partial class Form3 : Form { public Form3() { InitializeComponent(); } private void Form3_Load(object sender, EventArgs e) { CustomersTableAdapter adapter = new CustomersTableAdapter(); = (); = bindingSource1; } private void dataGridView1_CellPainting(object sender, DataGridViewCellPaintingEventArgs e) { if ( < 0) { (, ); = true; } } private void dataGridView1_EditingControlShowing(object sender, DataGridViewEditingControlShowingEventArgs e) { if ( == 1) { // = ("window"); //DataGridViewComboBoxEditingControl editingControl = as DataGridViewComboBoxEditingControl; DataGridViewTextBoxEditingControl editingControl = as DataGridViewTextBoxEditingControl; += new EventHandler(editingControl_TextChanged); } } void editingControl_TextChanged(object sender, EventArgs e) { this. = (); } } }
I hope this article will be helpful to everyone's C# programming.
Related Articles
Calling methods of unmanaged DLLs from C# programs
This article mainly introduces the method of calling unmanaged DLLs from C# programs. It is a very practical technique and helps to have a deep understanding of Windows programming. Friends who need it can refer to it.2014-10-10C# implements custom FTP operation encapsulation class instance
This article mainly introduces C# to implement custom FTP operation encapsulation classes, involving the implementation techniques of C# operation FTP connection, transmission, download and other operations. It is very practical. Friends who need it can refer to it.2015-03-03C# realizes student achievement management system
This article mainly introduces C# to implement the student achievement management system. The sample code in the article is introduced in detail and has certain reference value. Interested friends can refer to it.2022-08-08Modify Windows operating system time using C#
This article mainly introduces the use of C# to modify the time of Windows operating system, so as to help everyone better utilize the C# operating system. Interested friends can learn about it.2020-10-10C# Method to determine whether a specified file is read-only
This article mainly introduces the method of C# to determine whether a specified file is read-only. It involves the skills of using Attributes attributes in C#. It is very practical. Friends who need it can refer to it.2015-04-04Use forced types in C# to implement conversion between strings and ASCII codes
This article mainly introduces the use of forced types in C# to implement the conversion between strings and ASCII codes. This article also provides another method. Friends who need it can refer to it.2014-08-08Escape character operation in C# XML
This article mainly introduces escape character operations in C# XML, which is of good reference value and hopes to be helpful to everyone. Let's take a look with the editor2021-01-01C# console program implements code sharing to enable and close SQLServer services
This article mainly introduces the code sharing of C# console program to enable and close SQLServer services. Friends who need it can refer to it2014-05-05C# method to implement the Bloom filter from bitmap to Bloom
Bloom filter is a special Hash Table that can quickly determine whether the data exists with a smaller storage space. Commonly used for data filtering that allows a certain misjudgment rate and prevent cache breakdown and other scenarios, this article will use C# language to implement a simple Bloom filter. For simplifying the explanation, it is designed very simple. Friends who need it can refer to it.2022-06-06Random() in C#
This article introduces the method of generating random numbers in C#, and the article introduces it in detail through sample code. It has certain reference value for everyone's study or work. Friends who need it can refer to it.2022-05-05