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

Error In RadGrid in Dynamic Data

1 Answer 88 Views
This is a migrated thread and some comments may be shown as answers.
Stephen Naughton
Top achievements
Rank 1
Stephen Naughton asked on 02 Oct 2010, 04:49 PM
I get the following error (Using VS2010 .Net and Dynamic Data + latest DD bits for Telerik RadGrid, and Entity Framework for data model);

Error: Store update, insert, or delete statement affected an unexpected number of rows (0). Entities may have been modified or deleted since entities were loaded. Refresh ObjectStateManager entries.

when Inserting with the following code;
    <telerik:GridTemplateColumn UniqueName="CommandColumn">
            <asp:LinkButton runat="server" ID="LinkButton1" Text="Edit" CommandName="Edit" /><br />
            <asp:LinkButton runat="server" ID="LinkButton2" Text="Delete" CommandName="Delete" OnClientClick='return confirm("Are you sure you want to delete this item?");'/>
            <asp:LinkButton runat="server" ID="LinkButton1" Text="Update" CommandName="Update" /><br />
            <asp:LinkButton runat="server" ID="LinkButton2" Text="Cancel" CommandName="Cancel" CausesValidation="false" />
    <%--<telerik:GridEditCommandColumn />
    <telerik:GridButtonColumn CommandName="Delete" Text="Delete" ConfirmText="Are you sure you want to delete this item?" />--%>

Note I've commented out the telerik command columns (wich work fine) to get the command buttons in the same column (and use icons removed for simplification)

Note: the error only occurs when clicking Update during Insert, and just by changing button the the two telerik buttons commented out the error goes away :(

Steve Naughton (MVP)

1 Answer, 1 is accepted

Sort by
Telerik team
answered on 07 Oct 2010, 09:21 AM
Hi Stephen,

Thank you for contacting us.

I tried to reproduce the described issue but to no avail. I am sending you a simple example which contains the RadGrid with the TempalteColumn from the code snippet which you posted. Please check it out and let me know what differs in your case.
Additionally if the described error is caused by ConcurrencyException you could check out the following online resources which explain the possible solutions:

Looking forward for your reply.

the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Asked by
Stephen Naughton
Top achievements
Rank 1
Answers by
Telerik team
Share this question