Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
MmDropDownList data binding
Message
General information
Forum:
ASP.NET
Category:
The Mere Mortals .NET Framework
Title:
MmDropDownList data binding
Miscellaneous
Thread ID:
01250814
Message ID:
01250814
Views:
75
Thanks Kevin! (previous post)

>but something isn't working (...previous post)

I have dropdown lists like
<mm:mmDropDownList ID="ddReason" runat="server" 
   BindOnPostBack="true" AutoPostBack="true"
   OnSelectedIndexChanged="ddReason_SelectedIndexChanged" 
   BindingValueSource="MyTable" BindingValueSourceMember="Reason">

<asp:ListItem>Reason 1</asp:ListItem>
<asp:ListItem>Reason 2</asp:ListItem>
<asp:ListItem>Reason 3</asp:ListItem>

</mm:mmDropDownList>
This way usually works, but not in AJAX postbacks. With BindOnPostBack="true" or an explicit BindControl(ddReason), mmDropDownList.OnBindData() isn't getting called. I suspect something different (which works,) happens when saving.

Also, I'm binding mmDropdownLists to SQL data in the Page_Load() and letting the ViewState take care of the list values, i.e., NOT saving the list data in a session object, and NOT requerying the list data.

mmDropDownList.OnBindData() isn't getting called.

In the first case (), when it gets to mmBusinessWebPage.BindControl(control, bindingSource, bindingMember), bindingSource and bindingMember are null, and BindControl exits.
1) I don't know that this kind of ListItem Reason 1 is supported in MMDropDownList
2) if I call BindControl(ddReason, "MyTable", "Reason"), it binds to the first value of the list -- saw that somewhere deep in the trace.
3) I haven't traced what happens with BindOnPostBack="true", but it also doesn't work.

In the second case (no more DataSet), BindControl() exits because, even though there are values in the mmDropDownList, the DataSet associated with the bindingSource is no longer around. I have lots of data driven dropdowns, (being shown and hidden depending on AJAXey stuff going on) and it would be ... bad ... to have to store each in a Session variable or requery them.

Help please!
Next
Reply
Map
View

Click here to load this message in the networking platform