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?