<EmptyDataTemplate>
<asp:DropDownList ID="ddlRateCode" runat="server" DataSourceID="odsRateCode" DataTextField="RateCode"
DataValueField="RateCodeID" SelectedValue='<%# Bind("RateCodeID") %>'>
</asp:DropDownList>
</EmptyDataTemplate>
views:
105answers:
1
A:
Try to force a manually DataBind()
Like this:
protected void GridView1_RowCreated(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.EmptyDataRow)
{
DropDownList ddl = (DropDownList)e.Row.FindControl("ddlRateCode");
if (ddl != null)
{
ddl.DataBind();
}
}
}
citronas
2010-02-01 15:48:24