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


    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
    Kostadin avatar
    1693 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.

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