Add new record edit form not displaying with dropdownlist

2 posts, 0 answers
  1. Max
    Max avatar
    3 posts
    Member since:
    May 2015

    Posted 23 Mar Link to this post

    Hi

    Does anyone one why this line is preventing the edit form from displaying when I click "add new record"? The edit form displays normally when I click edit on a row.

    <asp:DropDownList ID="lst_ProjectCode" class="form-control" runat="server" Width="250" DataSourceID="SqlDataSource2" DataValueField="ProjectCode" SelectedValue='<%# Bind("ProjectCode")%>'></asp:DropDownList>

    It is something to do with the SelectedValue='<%# Bind("ProjectCode")%>' as otherwise it the edit form comes up.

     

     

  2. Kostadin
    Admin
    Kostadin avatar
    1711 posts

    Posted 28 Mar Link to this post

    Hi Max,

    The reason for reeving an exception is that the value of the ProjectCode field is null. What I can suggest you is to predefined a value when init insert command is fired. You can find more information on the matter in the following help article.

    Regards,
    Kostadin
    Telerik
    Do you need help with upgrading your ASP.NET AJAX, WPF or WinForms projects? Check the Telerik API Analyzer and share your thoughts.
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top