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.0DualListControl does not work in moduleDualListControl does not work in module
Previous
 
Next
New Post
5/2/2007 3:40 PM
 

I'm trying to use the DualListControl in a module. I'm using DNN 4.5.1. I have set it up the same as in the Core's SiteSettings control. In my .ascx file--

<%@ register src="~/controls/duallistcontrol.ascx" tagname="duallistcontrol" tagprefix="dnn" %>
......
<dnn:duallistcontrol id="DualList" runat="server" datatextfield="MenuText" datavaluefield="MenuItemID" listboxheight="130" listboxwidth="130" />

in my .ascx.vb file--

Dim alAvailable As New ArrayList( <Generic.List(Of MenuInfo).ToArray> )
Dim alAssigned As New ArrayList( <Generic.List(Of MenuInfo).ToArray> )
With DualList
    .Available = alAvailable
    .Assigned = alAssigned
End With

The ArrayLists "alAvailable" and "alAssigned" are fully loaded before being assigned to the ".Available" and ".Assigned" properties of the DualListControl. "DataTextField" and "DataValueField" are pointing at actual properties in the objects. But when the module is rendered, the control's ListBoxes are correctly sized, but empty. No matter how I approach it, I can't get it to populate the ListBoxes.

What am I missing?

 
New Post
5/3/2007 10:45 AM
 

I'm now submitting this to Gemini as a Severe or Showstopper bug, with the fix. It's not a showstopper in that DNN won't run, but it is in that the control is not usable in a user module.

Others have complained on the ASP.NET forums that they can't toggle the enable feature, particularly for the LinkButtons

The fix is to move the databinding procedures for the ListBoxes--

' load available
lstAvailable.DataTextField = _DataTextField
lstAvailable.DataValueField = _DataValueField
lstAvailable.DataSource = _Available
lstAvailable.DataBind()
Sort(lstAvailable)

' load selected
lstAssigned.DataTextField = _DataTextField
lstAssigned.DataValueField = _DataValueField
lstAssigned.DataSource = _Assigned
lstAssigned.DataBind()
Sort(lstAssigned)

' set enabled
lstAvailable.Enabled = _Enabled
lstAssigned.Enabled = _Enabled
cmdAdd.Enabled = _Enabled
cmdRemove.Enabled = _Enabled
cmdAddAll.Enabled = _Enabled
cmdRemoveAll.Enabled = _Enabled

Move them from "Page_Load" to "Page_PreRender," and do NOT enclose them in an "If Not Page.IsPostBack" block. Also move the ".Enabled" commands, and add ".Enabled" for the LinkButtons.

As the control is written now, it only populates the ListBoxes upon page entry without a postback. It cannot be used in any context where it must respond to a postback. The proposed change will not affect the control's operation on the SiteSettings admin page, but will make it usable for user modules.

 
Previous
 
Next
HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0DualListControl does not work in moduleDualListControl does not work in module


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