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

HomeHomeDevelopment and...Development and...DNN Platform (o...DNN Platform (o...formView and DualListControl weirdnessformView and DualListControl weirdness
Previous
 
Next
New Post
2/24/2009 7:37 PM
 

Okay, I've played around with for the better part of a day, and I'm still stumped.

I have a formView I use to insert and update records.  It has an EditTemplate and InsertTemplate which are very similar.  Early on, I found I could only find controls (using FVSeries.FindControl() -- my formview is named FVSeries) in the Page_Load event if the form was in Insert mode.  A bunch of Google searches led me to move my code into the Databound event of the formView.  From there, everything worked fine except this dang DualListControl.

In the Databound event of the formView, I have code like this, which is supposed to load up the Available list with talks:

            foreach (SIMS_Talk tlk in talks)
            {
                ((DualListControl)FVSeries.FindControl("dlcTalks")).Available.Add(new ListItem(tlk.Title, tlk.TalkID.ToString()));
            }

Stepping through with the debugger, this is definitely adding 7 talks to the control.  It's declared in the ascx this way:

        <dnn:DualListControl ID="dlcTalks" runat="server" DataTextField="Text" DataValueField="Value" />
 

But when the page loads, the Available listbox is empty.  What gives?  Now, if I move this code to the Page_Load event, it works fine, as long as the formView is in Insert mode.  Switch it to Edit mode and it throws an exception because it's unable to find the control (which is right there in the edit template, but since I discovered this happened with all controls on the form, it wasn't specific to DualListControl).

So has anyone else noticed weirdness with DualListControl on formViews in Edit mode?

 
New Post
2/25/2009 2:13 PM
 

Update:

I tossed the formview and wrote the form from scratch.  Everything worked as expected.  So for anyone trying to work with formviews and the duallistcontrol, you might save yourself a headache by just not going there ;-)

AldenG

 
Previous
 
Next
HomeHomeDevelopment and...Development and...DNN Platform (o...DNN Platform (o...formView and DualListControl weirdnessformView and DualListControl weirdness


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