AJAX ComboBox - dropdown button missing
Using an AJAX combobox inside of an accordion control. In fact, its an accordion control nested inside another accordion, if that could be a problem.
Anyway -- I have two combo boxes - on the first one it seems like on any page postback the drop down button to see the list of available items disappears. On the second one, its 开发者_如何学Gonever there.
Here is the code:
<asp:AccordionPane ID="Pane1" runat="server" HeaderCssClass="accordionHeader" ContentCssClass="accordionContent" >
<Header>
QUERY VIEW
</Header>
<Content>
<asp:Label ID="lbl_chkOne" CssClass="label" runat="server" Text="By User" ></asp:Label>
<input id="chk_One" type="checkbox" onclick="changePane(0,this)" groupKey="query" />
<asp:Label ID="lbl_chkTwo" CssClass="label" runat="server" Text="All Users" ></asp:Label>
<input id="chk_Two" type="checkbox" onclick="changePane(1,this)" groupKey="query" />
<asp:Label ID="lbl_chkThree" CssClass="label" runat="server" Text="Other" ></asp:Label>
<input id="chk_Three" type="checkbox" onclick="changePane(2,this)" groupKey="query" />
<br />
<br />
<asp:Accordion ID="InnerAccordion" runat="server">
<Panes>
<asp:AccordionPane ID="Pane3" runat="server" Visible="true" >
<Content>
<asp:Panel ID="Panel1" runat="server">
<asp:Label ID="Label2" runat="server" Text="Select a User:"
Style="margin-left:28px" ></asp:Label>
<asp:ComboBox ID="cbox_User" runat="server" AutoCompleteMode="SuggestAppend">
</asp:ComboBox>
<asp:Label ID="Label3" runat="server" Text="Select a Month:"
Style="margin-left:28px" ></asp:Label>
<asp:TextBox ID="txt_Date" runat="server"></asp:TextBox>
<asp:Label ID="Label1" runat="server" Text="Enter a Price:"
Style="margin-left:28px" ></asp:Label>
<asp:TextBox ID="txt_Price" runat="server"></asp:TextBox>
<asp:CalendarExtender ID="CalendarExtender1" runat="server"
TargetControlID="txt_Date"
Format="MMMM yyyy"
OnClientShown="onCalendarShown"
OnClientHidden="onCalendarHidden"
BehaviorID="calendar1" >
</asp:CalendarExtender>
<br />
</asp:Panel>
</Content>
</asp:AccordionPane>
<asp:AccordionPane ID="Pane4" runat="server" Visible="true" >
<Content>
<asp:Panel ID="Panel4" runat="server">
<asp:Label ID="Label10" runat="server" Text="Select a Group:"
Style="margin-left:28px" ></asp:Label>
<asp:ComboBox ID="cbox_Group" runat="server" >
<asp:ListItem Text="All Groups"> </asp:ListItem>
<asp:ListItem Text="Customers" > </asp:ListItem>
<asp:ListItem Text="Employees" > </asp:ListItem>
</asp:ComboBox>
<asp:Label ID="Label11" runat="server" Text="Select a Month:"
Style="margin-left:28px" ></asp:Label>
<asp:TextBox ID="TextBox5" runat="server"></asp:TextBox>
<asp:Label ID="Label12" runat="server" Text="Enter a Price:"
Style="margin-left:28px" ></asp:Label>
<asp:TextBox ID="TextBox6" runat="server"></asp:TextBox>
<br />
</asp:Panel>
</Content>
cbox_User is the one that initially displays the button and then it disappears on postback. cbox_Groups is the one that never shows the button.
Here is the code behind that binds data to cbox_User:
protected void BindUsers()
{
IQueryable<AqUser> query = from users in db.AqUser
orderby users.username
select users;
cbox_User.DataSource = query;
cbox_User.DataTextField = "username";
cbox_User.DataValueField = "username";
cbox_User.DataBind();
}
protected void Page_Load(object sender, EventArgs e)
{
db = new DBEntities();
BindUsers();
if (!Page.IsPostBack)
OuterAccordion.Panes[1].Visible = false;
else
OuterAccordion.Panes[1].Visible = true;
}
I couldn't find much on the internet about this except for some posts about it possibily being related to divs / css alignment.
Any ideas?
Never could solve this. Must be a big they need to fix.
I used DropDownList instead of ComboBox and it works fine.
精彩评论