I did this a long time ago in a DNN 3 module. Here are some of the methods. I added/updated the list items by clicking a command button or changing a dropdownlist. Maybe you can sift through these.... (BTW I hate posting code in the FCK editor, it always gets screwed up. I pasted as text)
Private Sub cmdUserAdd_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdUserAdd.Click
Dim objListItem As ListItem
Dim objList As ArrayList = New ArrayList
For Each objListItem In lstUserAvailable.Items
objList.Add(objListItem)
Next
For Each objListItem In objList
If objListItem.Selected Then
lstUserAvailable.Items.Remove(objListItem)
lstUserAssigned.Items.Add(objListItem)
End If
Next
lstUserAvailable.ClearSelection()
lstUserAssigned.ClearSelection()
Sort(lstUserAssigned)
End Sub
Private Sub cmdUserRemove_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdUserRemove.Click
Dim objListItem As ListItem
Dim objList As ArrayList = New ArrayList
For Each objListItem In lstUserAssigned.Items
objList.Add(objListItem)
Next
For Each objListItem In objList
If objListItem.Selected Then
lstUserAssigned.Items.Remove(objListItem)
lstUserAvailable.Items.Add(objListItem)
End If
Next
lstUserAvailable.ClearSelection()
lstUserAssigned.ClearSelection()
Sort(lstUserAvailable)
End Sub
Private Sub cmdUserAddAll_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdUserAddAll.Click
Dim objListItem As ListItem
For Each objListItem In lstUserAvailable.Items
lstUserAssigned.Items.Add(objListItem)
Next
lstUserAvailable.Items.Clear()
lstUserAvailable.ClearSelection()
lstUserAssigned.ClearSelection()
Sort(lstUserAssigned)
End Sub
Private Sub cmdUserRemoveAll_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdUserRemoveAll.Click
Dim objListItem As ListItem
For Each objListItem In lstUserAssigned.Items
lstUserAvailable.Items.Add(objListItem)
Next
lstUserAssigned.Items.Clear()
lstUserAvailable.ClearSelection()
lstUserAssigned.ClearSelection()
Sort(lstUserAvailable)
End Sub
Private Sub Sort(ByVal ctlListBox As ListBox)
Dim arrListItems As New ArrayList
Dim objListItem As ListItem
' store listitems in temp arraylist
For Each objListItem In ctlListBox.Items
arrListItems.Add(objListItem)
Next
' sort arraylist based on text value
arrListItems.Sort(New ListItemComparer)
' clear control
ctlListBox.Items.Clear()
' add listitems to control
For Each objListItem In arrListItems
ctlListBox.Items.Add(objListItem)
Next
End Sub
Private Sub ddlLocs1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ddlLocs1.SelectedIndexChanged
'fill dualistcontrol
lstUserAvailable.Visible = True
lstUserAvailable.ClearSelection()
lstUserAssigned.ClearSelection()
lstUserAvailable.Items.Clear()
Dim loc As Integer = CType(ddlLocs1.SelectedValue, Integer)
_arrAvailable = locCtrl.FieldsLP_GetLocUsers(loc)
lstUserAvailable.DataSource = _arrAvailable
lstUserAvailable.DataTextField = "LastName"
lstUserAvailable.DataValueField = "UserId"
lstUserAvailable.DataBind()
End Sub
Private Sub rblLocGroup_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles rblLocGroup.SelectedIndexChanged
If rblLocGroup.SelectedIndex <> -1 And rblRole.SelectedIndex <> 1 Then
_arrAvailable = locCtrl.FieldsLP_GetUsersByLocTypeAndRole("group", rblLocGroup.SelectedValue, rblRole.SelectedValue)
lstUserAvailable.DataSource = _arrAvailable
lstUserAvailable.DataTextField = "FullName"
lstUserAvailable.DataValueField = "UserId"
lstUserAvailable.DataBind()
rblLocRegion.SelectedIndex = -1
End If
End Sub