views:

105

answers:

1
<EmptyDataTemplate>
                  <asp:DropDownList ID="ddlRateCode" runat="server" DataSourceID="odsRateCode" DataTextField="RateCode"
                        DataValueField="RateCodeID" SelectedValue='<%# Bind("RateCodeID") %>'>
                    </asp:DropDownList>
   </EmptyDataTemplate>
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