Angela4eva
asked on
Formview dropdown help
In the below code is not working.
SelectedValue='<%#DataBind
intelissense does not show selectedvalue, how can i populate the selected value .please help.
formview>
<ItemTemplate>
<td>
<asp:DropDownList ID="ddlIssuanceMonth" runat="server" Enabled="false"
SelectedValue='<%#DataBinder.Eval(Container.DataItem,"IssuanceMonth")%>'>
</asp:DropDownList>
</td>
--codebehind
protected void FVInvestigations_PreRender(object sender, EventArgs e)
{
DateTime month = Convert.ToDateTime("1/1/2000");
for (int i = 0; i < 12; i++)
{
DateTime NextMont = month.AddMonths(i);
ListItem list = new ListItem();
list.Text = NextMont.ToString("MMMM");
list.Value = NextMont.Month.ToString();
((DropDownList)(FVInvestigations.FindControl("ddlIssuanceMonth"))).Items.Add(list);
}
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Open in new window