You have a DetailsView control with edit / add and all the other goodness enabled, but when adding a new record you want a non-visible field to get it’s value from another control like the SelectedValue of a GridView or a DropDownList in the InsertParameters collection of your SqlDataSource just use a ControlParameter instead
[codesyntax lang=”csharp”]
<InsertParameters> <asp:ControlParameter ControlID="ddlYourList" Name="ParameterName" PropertyName="SelectedValue" Type="Int32" /> <asp:Parameter Name="SomeDetailsViewParameter" Type="String" /> </InsertParameters>
[/codesyntax]