cnd
cnd

Reputation: 33764

ajaxToolkit:DropDownExtender where is items?

<asp:TextBox ID="TextBox5" runat="server" Height="30px" Width="68px"></asp:TextBox>
<ajaxToolkit:DropDownExtender ID="TextBox5_DropDownExtender" runat="server" 
DynamicServicePath="" Enabled="True" TargetControlID="TextBox5">
</ajaxToolkit:DropDownExtender>

    //this.TextBox5_DropDownExtender ????
    YearList.Items.Add(DateTime.Today.AddYears(-i).ToString("yyyy"));

Question : where is items for this DropDownExtender ?

Upvotes: 1

Views: 2450

Answers (1)

Nick Craver
Nick Craver

Reputation: 630509

There's a property called DropDownControlID on the extender. Point that to a panel and put your items there. Something like this:

<asp:TextBox ID="TextBox5" runat="server" Height="30px" Width="68px" />
<ajaxToolkit:DropDownExtender ID="TextBox5_DropDownExtender" runat="server" 
 DynamicServicePath="" Enabled="True" TargetControlID="TextBox5"
 DropDownControlID="pnlItems" />

<asp:Panel ID="pnlItems" runat="server" BorderColor="Black" BorderWidth="1">
   <asp:BulletedList ID="YearList" runat="server" />
</asp:Panel>

In code, add items to YearList.

Upvotes: 2

Related Questions