This is a migrated thread and some comments may be shown as answers.

Add new record edit form not displaying with dropdownlist

1 Answer 34 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Max
Top achievements
Rank 1
Max asked on 24 Mar 2016, 02:31 AM

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.

 

 

1 Answer, 1 is accepted

Sort by
0
Kostadin
Telerik team
answered on 28 Mar 2016, 09:58 AM
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.
Tags
Grid
Asked by
Max
Top achievements
Rank 1
Answers by
Kostadin
Telerik team
Share this question
or