How to use a DataGridViewButtonColumn in an unrelated DataGridView

Using WinForms, C # .Net 2.0

I am adding rows to an unrelated DataGridView. I would like to have a DataGridViewButtonColumn in one of the columns that deletes this row when clicked. When I try to add a Click event to a DataGridViewButtonColumn, there is no definition for Click.

Can someone point me to an MSDN article or direct me to an answer?

Thanks!

+3
source share
2 answers

The DataGridViewButtonColumn class is a container class for DataGridViewButtonCell objects. These objects have the click events you are looking for.

http://msdn.microsoft.com/en-us/library/system.windows.forms.datagridviewbuttoncolumn_members.aspx

+2

DataGridViewButtonColumn MSDN :

, DataGridView.CellClick DataGridView.CellContentClick. DataGridViewCellEventArgs.ColumnIndex, , . DataGridViewCellEventArgs.RowIndex , , .

+2

Source: https://habr.com/ru/post/1711103/


All Articles