C# - DataGridView's method UserDeletingRow occurs two times
this is a windows form application and it has a DataGridView control. The
problem is that method DataGridView1_UserDeletingRow occurs two times when
I run the application, and I don't understand why.
public partial class ShowAllTransactions : UserControl
{
public ShowAllTransactions()
{
InitializeComponent();
}
private void DataGridView1_UserDeletingRow(object sender,
DataGridViewRowsRemovedEventArgs e)
{
MessageBox.Show(sender.ToString());
}
private void ShowAllTransactions_Load(object sender, EventArgs e)
{
dataGridView1.RowsRemoved += new
DataGridViewRowsRemovedEventHandler(DataGridView1_UserDeletingRow);
}
}
Thank you
No comments:
Post a Comment