I am working on a very low priority issue. While I've noticed it, either no customers have noticed it or didn't care enough to complain about it. So if you have time to think about this with me, great; otherwise feel free to help those expressing more urgency.
I have an asp.net page that contains two instances of a user control called ApproverControl.ascx. Its job is to add/remove users from a list. So on the left side is a listbox of users that can be added as a level one approver. When you hit the greater-than button it will add the selected user to the box on the right and remove him from the box on the left. If you hit the less-than button, it will remove the hiighted user from the right and put him back in the left. This is an operation we see all the time.
The problem is there are two of these because there are level one approvers and level two approvers, and they each need to know what the other is doing. If someone is selected as a level 1 approver, he gets moved from the L1 box on the left to the right correctly, but he also should be (and is not, that is the bug) removed from the L2 left-hand box. If someone is selected as a L1 approver, he should no longer be presented as a possible L2 approver, and vice versa.
This is the code. "SelectAnItem" is the name of the greater-than button.
But when AddApprover() is called in the L1 instance of ApproverControl.ascx, how do I call RemoveApprover in the L2 instance of ApproverControl.ascx?Code:Private Sub SelectAnItemClick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SelectAnItem.Click For i As Integer = UnselectedItemsBox.Items.Count - 1 To 0 Step -1 If UnselectedItemsBox.Items(i).Selected Then AddApprover(UnselectedItemsBox.Items(i)) End If Next SelectedItemsBox.SelectedIndex = -1 UnselectedItemsBox.SelectedIndex = -1 End Sub Private Sub AddApprover(ByVal itemToAdd As ListItem) If UnselectedItemsBox.Items.Contains(itemToAdd) Then SelectedItemsBox.Items.Add(itemToAdd) UnselectedItemsBox.Items.Remove(itemToAdd) End If SelectAnItem.Enabled = (SelectedItemsBox.Items.Count < MaxSelectedItems) RemoveAnItem.Enabled = (SelectedItemsBox.Items.Count > 0) End Sub Private Sub RemoveApprover(ByVal itemToRemove As ListItem) If SelectedItemsBox.Items.Contains(itemToRemove) Then SelectedItemsBox.Items.Remove(itemToRemove) UnselectedItemsBox.Items.Add(itemToRemove) End If SelectAnItem.Enabled = (SelectedItemsBox.Items.Count < MaxSelectedItems) RemoveAnItem.Enabled = (SelectedItemsBox.Items.Count > 0) End Sub