I have the absolutely most simple setup imaginable. A single table defined in an Entity model in ASP.net v4, the model is bound directly to a GridView with AutoGenerateEditButton enabled.
However, each time I hit edit, then save, the page throws the error “Update is disabled for this control" for which I cannot find a solution.
What is causing this error? What can do to resolve it?
<%
<asp:GridView ID="MenuItemsGrid" runat="server"
DataSourceID="gridDataSource"
AutoGenerateEditButton="true"
AutoGenerateColumns="true">
</asp:GridView>
<asp:EntityDataSource ID="gridDataSource" runat="server"
ConnectionString="name=dataEntitiesModel"
DefaultContainerName="dataEntities"
EntitySetName="MenuItems" />
%>
Well, that was easy. The data source needs to be enabled for insert/edit & delete.
<%
<asp:EntityDataSource ID="gridDataSource" runat="server"
ConnectionString="name=dataEntitiesModel"
DefaultContainerName="ASDKidsPlayEntities" EntitySetName="MenuItems"
EnableDelete="True" EnableInsert="True" EnableUpdate="True"/>
%>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With