contextmenus - accessing control they are associated with
Posted on 2006-05-31
The following method is from a ContextStripMenu Item. I want the method to delete all the selected rows of a datagridview, which it does. My issue is I have 4 datagridviews that use the same ContextStripMenu and I would like to pass in the datagridview name dynamically. Is their a way to pass the datagridview through e or find it in the sender object? Or is their another way to do this, without creating 4 separate ContextStripMenus for each datagridview.
private void deleteToolStripMenuItem_Click(object sender, EventArgs e)
foreach (DataGridViewRow row in this.dgvReportAssignment.SelectedRows)
Thanks for your help!