private void teamMembers_Click(object sender, EventArgs e) { var senderTeam = this.FindAncestor <OrgContainerShape>(); var diagramElement = this.FindAncestor <RadDiagramElement>(); if (senderTeam.IsCollapsed) { return; } if (addTeam == null) { context = new RadContextMenu(); //addTeam = new RadMenuItem() { Text = "Add Team" }; //addTeam.Click += addTeam_Click; //context.Items.Add(addTeam); //renameTeam = new RadMenuItem() { Text = "Rename Team" }; //renameTeam.Click += renameTeam_Click; //context.Items.Add(renameTeam); removeTeam = new RadMenuItem() { Text = "Remove Team" }; removeTeam.Click += removeTeam_Click; // context.Items.Add(addTeam); context.Items.Add(removeTeam); } removeTeam.Enabled = !diagramElement.Connections.Where(x => x.Source == senderTeam).Any(); context.Show(System.Windows.Forms.Control.MousePosition); }