Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0DualListControlDualListControl
Previous
 
Next
New Post
6/16/2007 5:02 PM
 

Hi,

I'm searching for a DualListControl documentation or a guide how to use it. Have you any idea where I can find something like that, or can you tell me how to use the control (adding, deleting items - which event handler...)?

Thank you

Kevin

 
New Post
6/18/2007 11:28 AM
 

I got it. Just added an empty ArrayList to DualListControl.Assigned and now I can add and delete my items.

Kevin

 
New Post
6/18/2007 11:51 AM
 

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

 
Previous
 
Next
HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0DualListControlDualListControl


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out