public ReproductiveStateChanges(TroopVisit troopVisit) { this.troopVisit = troopVisit; this.Text = "Reproducive States:- " + troopVisit.ToString(); foreach (ReproductiveState r in Session .CreateQuery("from ReproductiveState").List <ReproductiveState>()) { ReproductiveStateButton b = new ReproductiveStateButton(r); b.Click += new System.EventHandler(ReproductiveStateButton_click); this.DataGridView.ContextMenuStrip.Items.Add(b); } }
public SightingChanges(TroopVisit tv) { this.bindingSource = new BindingSource(); this.troop = tv.Troop; this.troopVisit = tv; this.Text = "Current Sightings:- " + tv.ToString(); // Add context menu to datagridview ContextMenuStrip rowContextMenu = new ContextMenuStrip(); ToolStripMenuItem notSeenButton = new ToolStripMenuItem(); notSeenButton.Text = "Set to Not Seen"; notSeenButton.Click += new System.EventHandler(notSeenButton_Click); ToolStripMenuItem editButton = new ToolStripMenuItem(); editButton.Text = "Advanced entry"; editButton.Click += new System.EventHandler(editButton_Click); //this.DataGridView.ContextMenuStrip = rowContextMenu; this.DataGridView.ContextMenuStrip.Items.AddRange(new ToolStripItem[] { notSeenButton, editButton }); }